class RoadBlockTrapController extends MasterController
{

	public const override function GetPS() : RoadBlockTrapControllerPS
	{
		return ( ( RoadBlockTrapControllerPS )( GetBasePS() ) );
	}

}

class RoadBlockTrapControllerPS extends MasterControllerPS
{

	protected override function Initialize()
	{
		super.Initialize();
	}

	protected override function OnRefreshSlavesEvent( evt : RefreshSlavesEvent ) : EntityNotificationType
	{
		RefreshSlaves();
		return EntityNotificationType.DoNotNotifyEntity;
	}

	public function RefreshSlaves()
	{
		var i : Int32;
		var devices : array< DeviceComponentPS >;
		var action : ActivateDevice;
		devices = GetImmediateSlaves();
		action = ActionActivateDevice();
		if( IsActivated() )
		{
			for( i = 0; i < devices.Size(); i = i + 1 )
			{
				if( ( ( RoadBlockControllerPS )( devices[ i ] ) ) )
				{
					( ( ScriptableDeviceAction )( action ) ).RegisterAsRequester( PersistentID.ExtractEntityID( GetID() ) );
					ExecutePSAction( action, devices[ i ] );
				}
			}
			m_activationState = EActivationState.DEACTIVATED;
		}
	}

	protected override function GetDeviceIconTweakDBID() : TweakDBID
	{
		return T"DeviceIcons.DoorDeviceIcon";
	}

	protected override function GetBackgroundTextureTweakDBID() : TweakDBID
	{
		return T"DeviceIcons.DoorDeviceBackground";
	}

}

