class SetAvoidLOSTimeStamp extends AIbehaviortaskScript
{
	private var m_initialized : Bool;
	private var m_actionBBoard : weak< IBlackboard >;

	protected override function Activate( context : ScriptExecutionContext )
	{
		if( !( m_initialized ) )
		{
			m_actionBBoard = GetPuppet( context ).GetAIControllerComponent().GetActionBlackboard();
		}
		m_actionBBoard.SetFloat( GetAllBlackboardDefs().AIAction.avoidLOSTimeStamp, EngineTime.ToFloat( ScriptExecutionContext.GetAITime( context ) ) );
	}

}

class ResetAvoidLOSTimeStamp extends AIbehaviortaskScript
{
	editable var m_onDeactivation : Bool;
	private var m_initialized : Bool;
	private var m_actionBBoard : weak< IBlackboard >;

	protected override function Activate( context : ScriptExecutionContext )
	{
		if( !( m_initialized ) )
		{
			m_actionBBoard = GetPuppet( context ).GetAIControllerComponent().GetActionBlackboard();
		}
		if( !( m_onDeactivation ) )
		{
			m_actionBBoard.SetFloat( GetAllBlackboardDefs().AIAction.avoidLOSTimeStamp, 0.0 );
		}
	}

	protected override function Deactivate( context : ScriptExecutionContext )
	{
		if( m_onDeactivation )
		{
			m_actionBBoard.SetFloat( GetAllBlackboardDefs().AIAction.avoidLOSTimeStamp, 0.0 );
		}
	}

}

