class ZonesPSMPrereqState extends PlayerStateMachinePrereqState
{
}

class ZonesPSMPrereq extends PlayerStateMachinePrereq
{

	protected export const override function OnRegister( state : PrereqState, game : GameInstance, context : IScriptable ) : Bool
	{
		var bb : IBlackboard;
		var castedState : ZonesPSMPrereqState;
		bb = GameInstance.GetBlackboardSystem( game ).GetLocalInstanced( ( ( ScriptedPuppet )( context ) ).GetEntityID(), GetAllBlackboardDefs().PlayerStateMachine );
		castedState = ( ( ZonesPSMPrereqState )( state ) );
		castedState.m_owner = ( ( GameObject )( context ) );
		castedState.m_prevValue = bb.GetInt( GetAllBlackboardDefs().PlayerStateMachine.Zones );
		castedState.m_listenerInt = bb.RegisterListenerInt( GetAllBlackboardDefs().PlayerStateMachine.Zones, castedState, 'OnStateUpdate' );
		return false;
	}

	protected export const override function OnUnregister( state : PrereqState, game : GameInstance, context : IScriptable )
	{
		var bb : IBlackboard;
		var castedState : ZonesPSMPrereqState;
		bb = GameInstance.GetBlackboardSystem( game ).GetLocalInstanced( ( ( ScriptedPuppet )( context ) ).GetEntityID(), GetAllBlackboardDefs().PlayerStateMachine );
		castedState = ( ( ZonesPSMPrereqState )( state ) );
		bb.UnregisterListenerInt( GetAllBlackboardDefs().PlayerStateMachine.Zones, castedState.m_listenerInt );
	}

	protected const override function GetStateMachineEnum() : String
	{
		return "gamePSMZones";
	}

	protected const override function GetCurrentPSMStateIndex( bb : IBlackboard ) : Int32
	{
		return bb.GetInt( GetAllBlackboardDefs().PlayerStateMachine.Zones );
	}

}

