#include <StateMachine.h>
Inherits MemoryPoolObject, and Snapshot.
Inherited by AIAttackAimAtTargetState, AIAttackAreaState, AIAttackFireWeaponState, AIAttackSquadState, AIAttackState, AIBusyState, AIDeadState, AIDockProcessDockState, AIDockState, AIDockWaitForClearanceState, AIExitInstantlyState, AIExitState, AIFaceState, AIGuardAttackAggressorState, AIGuardIdleState, AIGuardInnerState, AIGuardOuterState, AIGuardRetaliateAttackAggressorState, AIGuardRetaliateIdleState, AIGuardRetaliateInnerState, AIGuardRetaliateOuterState, AIGuardRetaliateState, AIGuardState, AIHuntState, AIIdleState, AIInternalMoveToState, AIRappelState, AITNGuardAttackAggressorState, AITNGuardIdleState, AITNGuardInnerState, AITNGuardOuterState, AITunnelNetworkGuardState, AIWaitState, ActAsDozerState, ActAsSupplyTruckState, ApproachState, ChinookCombatDropState, ChinookEvacuateState, ChinookHeadOffMapState, ChinookRecordCreationState, ChinookTakeoffOrLandingState, CleanUpState, ConsiderNewApproachState, ContinueState, DeliveringState, DockingState, DozerActionDoActionState, DozerActionMoveToActionPosState, DozerActionPickActionPosState, DozerActionState, DozerPrimaryGoingHomeState, DozerPrimaryIdleState, FailureState, HackInternetState, HeadOffMapState, HeliTakeoffOrLandingState, JetAwaitingRunwayState, JetOrHeliCirclingDeadAirfieldState, JetOrHeliParkOrientState, JetOrHeliReloadAmmoState, PackingState, RecoverFromOffMapState, RegroupingState, SleepState, SuccessState, SupplyTruckBusyState, SupplyTruckIdleState, SupplyTruckWantsToPickUpOrDeliverBoxesState, TurretState, and UnpackingState.
Public Member Functions | |
| State (StateMachine *machine, AsciiString name) | |
| < this abstract class needs memory pool hooks | |
| virtual StateReturnType | onEnter () |
| executed once when entering state | |
| virtual void | onExit (StateExitType status) |
| executed once when leaving state | |
| virtual StateReturnType | update ()=0 |
| implements this state's behavior, decides when to change state | |
| virtual Bool | isIdle () const |
| virtual Bool | isAttack () const |
| virtual Bool | isGuardIdle () const |
| virtual Bool | isBusy () const |
| StateMachine * | getMachine () |
| return the machine this state is part of | |
| StateID | getID () const |
| get this state's id | |
| Object * | getMachineOwner () |
| const Object * | getMachineOwner () const |
| Object * | getMachineGoalObject () |
| return the machine this state is part of | |
| const Object * | getMachineGoalObject () const |
| return the machine this state is part of | |
| const Coord3D * | getMachineGoalPosition () const |
| return the machine this state is part of | |
| void | friend_setID (StateID id) |
| define this state's id (for use only by StateMachine class) | |
| void | friend_onSuccess (StateID toStateID) |
| define which state to move to after successful completion | |
| void | friend_onFailure (StateID toStateID) |
| define which state to move to after failure | |
| void | friend_onCondition (StateTransFuncPtr test, StateID toStateID, void *userData, const char *description=NULL) |
| define when to change state | |
| StateReturnType | friend_checkForTransitions (StateReturnType status) |
| given a return code, handle state transitions | |
| StateReturnType | friend_checkForSleepTransitions (StateReturnType status) |
| given a return code, handle state transitions | |
Public Member Functions inherited from MemoryPoolObject | |
| void | deleteInstance () |
Public Member Functions inherited from Snapshot | |
| Snapshot (void) | |
| ~Snapshot (void) | |
Protected Member Functions | |
| virtual void | crc (Xfer *xfer)=0 |
| run the "light" crc check on this data structure | |
| virtual void | xfer (Xfer *xfer)=0 |
| virtual void | loadPostProcess ()=0 |
Protected Member Functions inherited from MemoryPoolObject | |
| virtual | ~MemoryPoolObject () |
| void * | operator new (size_t s) |
| void | operator delete (void *p) |
| virtual MemoryPool * | getObjectMemoryPool ()=0 |
An abstraction of a machine's "state".
Definition at line 144 of file StateMachine.h.
| State::State | ( | StateMachine * | machine, |
| AsciiString | name ) |
< this abstract class needs memory pool hooks
Constructor
Definition at line 57 of file StateMachine.cpp.
|
protectedpure virtual |
run the "light" crc check on this data structure
Implements Snapshot.
Implemented in ActAsDozerState, ActAsSupplyTruckState, AIAttackAimAtTargetState, AIAttackApproachTargetState, AIAttackAreaState, AIAttackFireWeaponState, AIAttackFollowWaypointPathState, AIAttackMoveToState, AIAttackPursueTargetState, AIAttackSquadState, AIAttackState, AIBusyState, AIDeadState, AIDockApproachState, AIDockProcessDockState, AIDockState, AIDockWaitForClearanceState, AIEnterState, AIExitInstantlyState, AIExitState, AIFaceState, AIFollowPathState, AIFollowWaypointPathExactState, AIFollowWaypointPathState, AIGuardAttackAggressorState, AIGuardIdleState, AIGuardInnerState, AIGuardOuterState, AIGuardRetaliateAttackAggressorState, AIGuardRetaliateIdleState, AIGuardRetaliateInnerState, AIGuardRetaliateOuterState, AIGuardRetaliateReturnState, AIGuardRetaliateState, AIGuardReturnState, AIGuardState, AIHuntState, AIIdleState, AIInternalMoveToState, AIMoveAndDeleteState, AIMoveAndEvacuateState, AIMoveAndTightenState, AIPanicState, AIPickUpCrateState, AIRappelState, AITNGuardAttackAggressorState, AITNGuardIdleState, AITNGuardInnerState, AITNGuardOuterState, AITNGuardReturnState, AITunnelNetworkGuardState, AIWaitState, AIWanderInPlaceState, AIWanderState, ApproachState, ChinookCombatDropState, ChinookEvacuateState, ChinookHeadOffMapState, ChinookMoveToBldgState, ChinookRecordCreationState, ChinookTakeoffOrLandingState, CleanUpState, ConsiderNewApproachState, ContinueState, DeliveringState, DockingState, DozerActionDoActionState, DozerActionMoveToActionPosState, DozerActionPickActionPosState, DozerActionState, DozerPrimaryGoingHomeState, DozerPrimaryIdleState, FailureState, HackInternetState, HeadOffMapState, HeliTakeoffOrLandingState, JetAwaitingRunwayState, JetOrHeliCirclingDeadAirfieldState, JetOrHeliParkOrientState, JetOrHeliReloadAmmoState, JetPauseBeforeTakeoffState, PackingState, RecoverFromOffMapState, RegroupingState, SleepState, SuccessState, SupplyTruckBusyState, SupplyTruckIdleState, SupplyTruckWantsToPickUpOrDeliverBoxesState, TurretAIAimTurretState, TurretAIHoldTurretState, TurretAIIdleScanState, TurretAIIdleState, TurretAIRecenterTurretState, and UnpackingState.
| StateReturnType State::friend_checkForSleepTransitions | ( | StateReturnType | status | ) |
given a return code, handle state transitions
Given a return code, handle state transitions
Definition at line 209 of file StateMachine.cpp.
| StateReturnType State::friend_checkForTransitions | ( | StateReturnType | status | ) |
given a return code, handle state transitions
Given a return code, handle state transitions
Definition at line 116 of file StateMachine.cpp.
| void State::friend_onCondition | ( | StateTransFuncPtr | test, |
| StateID | toStateID, | ||
| void * | userData, | ||
| const char * | description = NULL ) |
define when to change state
Add another state transition condition for this state
Definition at line 72 of file StateMachine.cpp.
|
inline |
define which state to move to after failure
Definition at line 179 of file StateMachine.h.
|
inline |
define which state to move to after successful completion
Definition at line 178 of file StateMachine.h.
|
inline |
define this state's id (for use only by StateMachine class)
Definition at line 177 of file StateMachine.h.
|
inline |
get this state's id
Definition at line 163 of file StateMachine.h.
|
inline |
return the machine this state is part of
Definition at line 162 of file StateMachine.h.
|
inline |
return the machine this state is part of
Definition at line 393 of file StateMachine.h.
|
inline |
return the machine this state is part of
Definition at line 394 of file StateMachine.h.
|
inline |
return the machine this state is part of
Definition at line 396 of file StateMachine.h.
|
inline |
Definition at line 390 of file StateMachine.h.
|
inline |
Definition at line 391 of file StateMachine.h.
|
inlinevirtual |
Reimplemented in AIAttackAimAtTargetState, AIAttackApproachTargetState, AIAttackAreaState, AIAttackFireWeaponState, AIAttackFollowWaypointPathState, AIAttackMoveToState, AIAttackPursueTargetState, AIAttackSquadState, AIAttackState, AIDockState, AIGuardAttackAggressorState, AIGuardIdleState, AIGuardInnerState, AIGuardOuterState, AIGuardPickUpCrateState, AIGuardRetaliateState, AIGuardReturnState, AIGuardState, AIHuntState, and AITunnelNetworkGuardState.
Definition at line 157 of file StateMachine.h.
|
inlinevirtual |
Reimplemented in AIBusyState.
Definition at line 160 of file StateMachine.h.
|
inlinevirtual |
Reimplemented in AIGuardIdleState, and AIGuardState.
Definition at line 158 of file StateMachine.h.
|
inlinevirtual |
Reimplemented in AIIdleState.
Definition at line 156 of file StateMachine.h.
|
protectedpure virtual |
post process phase for loading save games. All save systems have their xfer run using XferLoad mode, and then all systems each have their post process run
Implements Snapshot.
Implemented in ActAsDozerState, ActAsSupplyTruckState, AIAttackAimAtTargetState, AIAttackApproachTargetState, AIAttackAreaState, AIAttackFireWeaponState, AIAttackFollowWaypointPathState, AIAttackMoveToState, AIAttackPursueTargetState, AIAttackSquadState, AIAttackState, AIBusyState, AIDeadState, AIDockApproachState, AIDockProcessDockState, AIDockState, AIDockWaitForClearanceState, AIEnterState, AIExitInstantlyState, AIExitState, AIFaceState, AIFollowPathState, AIFollowWaypointPathExactState, AIFollowWaypointPathState, AIGuardAttackAggressorState, AIGuardIdleState, AIGuardInnerState, AIGuardOuterState, AIGuardRetaliateAttackAggressorState, AIGuardRetaliateIdleState, AIGuardRetaliateInnerState, AIGuardRetaliateOuterState, AIGuardRetaliateReturnState, AIGuardRetaliateState, AIGuardReturnState, AIGuardState, AIHuntState, AIIdleState, AIInternalMoveToState, AIMoveAndDeleteState, AIMoveAndEvacuateState, AIMoveAndTightenState, AIPanicState, AIPickUpCrateState, AIRappelState, AITNGuardAttackAggressorState, AITNGuardIdleState, AITNGuardInnerState, AITNGuardOuterState, AITNGuardReturnState, AITunnelNetworkGuardState, AIWaitState, AIWanderInPlaceState, AIWanderState, ApproachState, ChinookCombatDropState, ChinookEvacuateState, ChinookHeadOffMapState, ChinookMoveToBldgState, ChinookRecordCreationState, ChinookTakeoffOrLandingState, CleanUpState, ConsiderNewApproachState, ContinueState, DeliveringState, DockingState, DozerActionDoActionState, DozerActionMoveToActionPosState, DozerActionPickActionPosState, DozerActionState, DozerPrimaryGoingHomeState, DozerPrimaryIdleState, FailureState, HackInternetState, HeadOffMapState, HeliTakeoffOrLandingState, JetAwaitingRunwayState, JetOrHeliCirclingDeadAirfieldState, JetOrHeliParkOrientState, JetOrHeliReloadAmmoState, JetPauseBeforeTakeoffState, PackingState, RecoverFromOffMapState, RegroupingState, SleepState, SuccessState, SupplyTruckBusyState, SupplyTruckIdleState, SupplyTruckWantsToPickUpOrDeliverBoxesState, TurretAIAimTurretState, TurretAIHoldTurretState, TurretAIIdleScanState, TurretAIIdleState, TurretAIRecenterTurretState, and UnpackingState.
|
inlinevirtual |
executed once when entering state
Reimplemented in ActAsDozerState, ActAsSupplyTruckState, AIAttackAimAtTargetState, AIAttackApproachTargetState, AIAttackAreaState, AIAttackFireWeaponState, AIAttackFollowWaypointPathState, AIAttackMoveToState, AIAttackPursueTargetState, AIAttackSquadState, AIAttackState, AIBusyState, AIDeadState, AIDockAdvancePositionState, AIDockApproachState, AIDockMoveToDockState, AIDockMoveToEntryState, AIDockMoveToExitState, AIDockMoveToRallyState, AIDockProcessDockState, AIDockState, AIDockWaitForClearanceState, AIEnterState, AIExitInstantlyState, AIExitState, AIFaceState, AIFollowPathState, AIFollowWaypointPathExactState, AIFollowWaypointPathState, AIGuardAttackAggressorState, AIGuardIdleState, AIGuardInnerState, AIGuardOuterState, AIGuardPickUpCrateState, AIGuardRetaliateAttackAggressorState, AIGuardRetaliateIdleState, AIGuardRetaliateInnerState, AIGuardRetaliateOuterState, AIGuardRetaliatePickUpCrateState, AIGuardRetaliateReturnState, AIGuardRetaliateState, AIGuardReturnState, AIGuardState, AIHuntState, AIIdleState, AIInternalMoveToState, AIMoveAndDeleteState, AIMoveAndEvacuateState, AIMoveAndTightenState, AIMoveAwayFromRepulsorsState, AIMoveOutOfTheWayState, AIMoveToState, AIPanicState, AIPickUpCrateState, AIRappelState, AITNGuardAttackAggressorState, AITNGuardIdleState, AITNGuardInnerState, AITNGuardOuterState, AITNGuardPickUpCrateState, AITNGuardReturnState, AITunnelNetworkGuardState, AIWanderInPlaceState, AIWanderState, ApproachState, ChinookCombatDropState, ChinookEvacuateState, ChinookHeadOffMapState, ChinookMoveToBldgState, ChinookRecordCreationState, ChinookTakeoffOrLandingState, CleanUpState, ConsiderNewApproachState, ContinueState, DeliveringState, DockingState, DozerActionDoActionState, DozerActionState, DozerPrimaryIdleState, FailureState, HackInternetState, HeadOffMapState, HeliTakeoffOrLandingState, JetAwaitingRunwayState, JetOrHeliCirclingDeadAirfieldState, JetOrHeliParkOrientState, JetOrHeliReloadAmmoState, JetOrHeliReturnForLandingState, JetOrHeliReturningToDeadAirfieldState, JetOrHeliTaxiState, JetPauseBeforeTakeoffState, JetTakeoffOrLandingState, PackingState, RecoverFromOffMapState, RegroupingState, SleepState, SuccessState, SupplyTruckBusyState, SupplyTruckIdleState, SupplyTruckWantsToPickUpOrDeliverBoxesState, TurretAIAimTurretState, TurretAIHoldTurretState, TurretAIIdleScanState, TurretAIIdleState, TurretAIRecenterTurretState, and UnpackingState.
Definition at line 152 of file StateMachine.h.
|
inlinevirtual |
executed once when leaving state
Reimplemented in AIAttackAimAtTargetState, AIAttackApproachTargetState, AIAttackAreaState, AIAttackFireWeaponState, AIAttackFollowWaypointPathState, AIAttackMoveToState, AIAttackPursueTargetState, AIAttackSquadState, AIAttackState, AIBusyState, AIDeadState, AIDockAdvancePositionState, AIDockApproachState, AIDockMoveToDockState, AIDockMoveToEntryState, AIDockMoveToExitState, AIDockMoveToRallyState, AIDockProcessDockState, AIDockState, AIDockWaitForClearanceState, AIEnterState, AIExitInstantlyState, AIExitState, AIFaceState, AIFollowPathState, AIFollowWaypointPathExactState, AIFollowWaypointPathState, AIGuardAttackAggressorState, AIGuardIdleState, AIGuardInnerState, AIGuardOuterState, AIGuardPickUpCrateState, AIGuardRetaliateAttackAggressorState, AIGuardRetaliateIdleState, AIGuardRetaliateInnerState, AIGuardRetaliateOuterState, AIGuardRetaliatePickUpCrateState, AIGuardRetaliateReturnState, AIGuardRetaliateState, AIGuardReturnState, AIGuardState, AIHuntState, AIInternalMoveToState, AIMoveAndDeleteState, AIMoveAndEvacuateState, AIMoveAwayFromRepulsorsState, AIMoveOutOfTheWayState, AIMoveToState, AIPanicState, AIPickUpCrateState, AIRappelState, AITNGuardAttackAggressorState, AITNGuardIdleState, AITNGuardInnerState, AITNGuardOuterState, AITNGuardPickUpCrateState, AITNGuardReturnState, AITunnelNetworkGuardState, AIWanderInPlaceState, AIWanderState, ChinookCombatDropState, ChinookMoveToBldgState, ChinookTakeoffOrLandingState, ConsiderNewApproachState, DeliveringState, DockingState, DozerActionDoActionState, DozerActionState, DozerPrimaryIdleState, HackInternetState, HeliTakeoffOrLandingState, JetAwaitingRunwayState, JetOrHeliParkOrientState, JetOrHeliReloadAmmoState, JetOrHeliTaxiState, JetPauseBeforeTakeoffState, JetTakeoffOrLandingState, PackingState, RegroupingState, SupplyTruckBusyState, SupplyTruckIdleState, SupplyTruckWantsToPickUpOrDeliverBoxesState, TurretAIAimTurretState, TurretAIHoldTurretState, TurretAIIdleScanState, TurretAIRecenterTurretState, and UnpackingState.
Definition at line 153 of file StateMachine.h.
|
pure virtual |
implements this state's behavior, decides when to change state
Implemented in ActAsDozerState, ActAsSupplyTruckState, AIAttackAimAtTargetState, AIAttackApproachTargetState, AIAttackAreaState, AIAttackFireWeaponState, AIAttackFollowWaypointPathState, AIAttackMoveToState, AIAttackPursueTargetState, AIAttackSquadState, AIAttackState, AIBusyState, AIDeadState, AIDockAdvancePositionState, AIDockApproachState, AIDockMoveToDockState, AIDockMoveToEntryState, AIDockMoveToExitState, AIDockMoveToRallyState, AIDockProcessDockState, AIDockState, AIDockWaitForClearanceState, AIEnterState, AIExitInstantlyState, AIExitState, AIFaceState, AIFollowPathState, AIFollowWaypointPathExactState, AIFollowWaypointPathState, AIGuardAttackAggressorState, AIGuardIdleState, AIGuardInnerState, AIGuardOuterState, AIGuardPickUpCrateState, AIGuardRetaliateAttackAggressorState, AIGuardRetaliateIdleState, AIGuardRetaliateInnerState, AIGuardRetaliateOuterState, AIGuardRetaliatePickUpCrateState, AIGuardRetaliateReturnState, AIGuardRetaliateState, AIGuardReturnState, AIGuardState, AIHuntState, AIIdleState, AIInternalMoveToState, AIMoveAndDeleteState, AIMoveAndEvacuateState, AIMoveAndTightenState, AIMoveAwayFromRepulsorsState, AIMoveOutOfTheWayState, AIMoveToState, AIPanicState, AIPickUpCrateState, AIRappelState, AITNGuardAttackAggressorState, AITNGuardIdleState, AITNGuardInnerState, AITNGuardOuterState, AITNGuardPickUpCrateState, AITNGuardReturnState, AITunnelNetworkGuardState, AIWaitState, AIWanderInPlaceState, AIWanderState, ApproachState, ChinookCombatDropState, ChinookEvacuateState, ChinookHeadOffMapState, ChinookMoveToBldgState, ChinookRecordCreationState, ChinookTakeoffOrLandingState, CleanUpState, ConsiderNewApproachState, ContinueState, DeliveringState, DockingState, DozerActionDoActionState, DozerActionMoveToActionPosState, DozerActionPickActionPosState, DozerActionState, DozerPrimaryGoingHomeState, DozerPrimaryIdleState, FailureState, HackInternetState, HeadOffMapState, HeliTakeoffOrLandingState, JetAwaitingRunwayState, JetOrHeliCirclingDeadAirfieldState, JetOrHeliParkOrientState, JetOrHeliReloadAmmoState, JetOrHeliTaxiState, JetPauseBeforeTakeoffState, JetTakeoffOrLandingState, PackingState, RecoverFromOffMapState, RegroupingState, SleepState, SuccessState, SupplyTruckBusyState, SupplyTruckIdleState, SupplyTruckWantsToPickUpOrDeliverBoxesState, TurretAIAimTurretState, TurretAIHoldTurretState, TurretAIIdleScanState, TurretAIIdleState, TurretAIRecenterTurretState, and UnpackingState.
|
protectedpure virtual |
run save, load, or deep CRC check on this data structure, the type depends on the setup of the Xfer pointer
Implements Snapshot.
Implemented in ActAsDozerState, ActAsSupplyTruckState, AIAttackAimAtTargetState, AIAttackApproachTargetState, AIAttackAreaState, AIAttackFireWeaponState, AIAttackFollowWaypointPathState, AIAttackMoveToState, AIAttackPursueTargetState, AIAttackSquadState, AIAttackState, AIBusyState, AIDeadState, AIDockApproachState, AIDockProcessDockState, AIDockState, AIDockWaitForClearanceState, AIEnterState, AIExitInstantlyState, AIExitState, AIFaceState, AIFollowPathState, AIFollowWaypointPathExactState, AIFollowWaypointPathState, AIGuardAttackAggressorState, AIGuardIdleState, AIGuardInnerState, AIGuardOuterState, AIGuardRetaliateAttackAggressorState, AIGuardRetaliateIdleState, AIGuardRetaliateInnerState, AIGuardRetaliateOuterState, AIGuardRetaliateReturnState, AIGuardRetaliateState, AIGuardReturnState, AIGuardState, AIHuntState, AIIdleState, AIInternalMoveToState, AIMoveAndDeleteState, AIMoveAndEvacuateState, AIMoveAndTightenState, AIPanicState, AIPickUpCrateState, AIRappelState, AITNGuardAttackAggressorState, AITNGuardIdleState, AITNGuardInnerState, AITNGuardOuterState, AITNGuardReturnState, AITunnelNetworkGuardState, AIWaitState, AIWanderInPlaceState, AIWanderState, ApproachState, ChinookCombatDropState, ChinookEvacuateState, ChinookHeadOffMapState, ChinookMoveToBldgState, ChinookRecordCreationState, ChinookTakeoffOrLandingState, CleanUpState, ConsiderNewApproachState, ContinueState, DeliveringState, DockingState, DozerActionDoActionState, DozerActionMoveToActionPosState, DozerActionPickActionPosState, DozerActionState, DozerPrimaryGoingHomeState, DozerPrimaryIdleState, FailureState, HackInternetState, HeadOffMapState, HeliTakeoffOrLandingState, JetAwaitingRunwayState, JetOrHeliCirclingDeadAirfieldState, JetOrHeliParkOrientState, JetOrHeliReloadAmmoState, JetPauseBeforeTakeoffState, PackingState, RecoverFromOffMapState, RegroupingState, SleepState, SuccessState, SupplyTruckBusyState, SupplyTruckIdleState, SupplyTruckWantsToPickUpOrDeliverBoxesState, TurretAIAimTurretState, TurretAIHoldTurretState, TurretAIIdleScanState, TurretAIIdleState, TurretAIRecenterTurretState, and UnpackingState.