Class TStateAware (unit State) |
Inherits from
TMessageAware
Class definition for a state-aware object.
constructor Create;
- Class constructor and destructor.
procedure AddToStateSequence(enumNewState: enumState; fValue1, fValue2: Real);
Methods to respond to commands in the state queue.
procedure ClearStateSequence;
Record that the object is now actively listening to states.
destructor Destroy;
Initialize the pending state queue and current state flag.
procedure ExitCurrentState;
Iterate through and remove each state tracking structure in the queue.
procedure Move;
Virtual method called to process pending states.
function bIsInState(enumStateToTest: enumState): Boolean;
If the entire pause interval has passed, then end the pause.
function bIsProcessingState: Boolean;
Informational methods.
procedure DeactivateCurrentState;
Routine to deactivate the currently active state.
procedure EnterState(pstCurrent: PState);
Virtual methods for customizing state behavior.
procedure ExitState(pstCurrent: PState);
Record time of pause start.
procedure ProcessState(pstCurrent: PState);
function stGetCurrentState: enumState;
m_bPendingStateExit : Boolean;
TRUE when we're processing command.
m_bProcessingState : Boolean;
Command currently being processed.
m_bStatesPending : Boolean;
TRUE when the current state has an exit pending.
m_lstPendingStates : TList;
m_stCurrent : PState;
Queue of pending commands.
constructor Create;
Class constructor and destructor.
TRUE when one or more states is pending.
procedure AddToStateSequence(enumNewState: enumState; fValue1, fValue2: Real);
Methods to respond to commands in the state queue.
Release our state queue.
procedure ClearStateSequence;
Record that the object is now actively listening to states.
destructor Destroy;
Initialize the pending state queue and current state flag.
procedure ExitCurrentState;
Iterate through and remove each state tracking structure in the queue.
procedure Move;
Virtual method called to process pending states.
Note: A maximum of one state change will occur during each iteration.
Derived classes use this information to perform further processing.
function bIsInState(enumStateToTest: enumState): Boolean;
If the entire pause interval has passed, then end the pause.
function bIsProcessingState: Boolean;
Informational methods.
procedure DeactivateCurrentState;
Routine to deactivate the currently active state.
Process the exit on the next movement.
procedure EnterState(pstCurrent: PState);
Virtual methods for customizing state behavior.
We are now processing a command.
procedure ExitState(pstCurrent: PState);
Record time of pause start.
procedure ProcessState(pstCurrent: PState);
function stGetCurrentState: enumState;
m_bPendingStateExit : Boolean;
TRUE when we're processing command.
m_bProcessingState : Boolean;
Command currently being processed.
m_bStatesPending : Boolean;
TRUE when the current state has an exit pending.
m_lstPendingStates : TList;
m_stCurrent : PState;
Queue of pending commands.