class ScannerModule extends HUDModule
{
	private var m_activeScans : array< ScanInstance >;

	private function InitiateFreshScan() {}

	protected override function Process( out task : HUDJob, mode : ActiveMode )
	{
		var instruction : ScanInstance;
		var lockedClueID : EntityID;
		var isScanningCluesBlocked : Bool;
		if( task.actor && task.actor.IsClue() )
		{
			lockedClueID = m_hud.GetLockedClueID();
			if( EntityID.IsDefined( lockedClueID ) && ( lockedClueID != task.actor.GetEntityID() ) )
			{
				isScanningCluesBlocked = true;
			}
		}
		instruction = task.instruction.scannerInstructions;
		if( instruction && task.actor )
		{
			instruction.SetState( InstanceState.ON, DuplicateLastInstance( task.actor ) );
			instruction.SetContext( IsActorLookedAt( task.actor ), task.actor.IsRevealed(), isScanningCluesBlocked );
		}
	}

	protected override function Process( out jobs : array< HUDJob >, mode : ActiveMode )
	{
		var i : Int32;
		for( i = 0; i < jobs.Size(); i += 1 )
		{
			Process( jobs[ i ], mode );
		}
	}

	public override function Suppress( jobs : ref< array< HUDJob > > )
	{
		var instruction : ScanInstance;
		var i : Int32;
		for( i = 0; i < jobs.Size(); i += 1 )
		{
			instruction = jobs[ i ].instruction.scannerInstructions;
			instruction.SetState( InstanceState.DISABLED, DuplicateLastInstance( jobs[ i ].actor ) );
			instruction.SetContext( false, false, false );
		}
	}

	protected override function DuplicateLastInstance( actor : HUDActor ) : ScanInstance
	{
		return ( ( ScanInstance )( super.DuplicateLastInstance( actor ) ) );
	}

}

class ScanInstance extends ModuleInstance
{
	var isScanningCluesBlocked : Bool;

	public function SetContext( _isLookedAt : Bool, _isRevealed : Bool, _isScanningCluesBlocked : Bool )
	{
		isLookedAt = _isLookedAt;
		isRevealed = _isRevealed;
		isScanningCluesBlocked = _isScanningCluesBlocked;
	}

}

