#include <AIStateMachine.h>
Inherits StateMachine.
Inherited by ChinookAIStateMachine, HackInternetStateMachine, HeliAIStateMachine, and JetAIStateMachine.
Public Member Functions | |
| AIStateMachine (Object *owner, AsciiString name) | |
| virtual void | clear () |
| clear the machine's internals to a known, initialized state | |
| virtual StateReturnType | resetToDefaultState () |
| clear the machine's internals and set to the default state | |
| virtual StateReturnType | setState (StateID newStateID) |
| change the current state of the machine (which may cause further state changes, due to onEnter) | |
| void | setGoalPath (const std::vector< Coord3D > *path) |
| void | addToGoalPath (const Coord3D *pathPoint) |
| const Coord3D * | getGoalPathPosition (Int i) const |
| return path position at index "i" | |
| Int | getGoalPathSize () const |
| void | setGoalWaypoint (const Waypoint *way) |
| move toward this waypoint, continue if connected | |
| const Waypoint * | getGoalWaypoint () |
| void | setGoalTeam (const Team *team) |
| void | setGoalSquad (const Squad *squad) |
| void | setGoalAIGroup (const AIGroup *group) |
| Squad * | getGoalSquad (void) |
| StateReturnType | setTemporaryState (StateID newStateID, Int frameLimitCoount) |
| change the temporary state of the machine, and number of frames limit. | |
| StateID | getTemporaryState (void) const |
| virtual StateReturnType | updateStateMachine () |
| run one step of the machine | |
Public Member Functions inherited from StateMachine | |
| StateMachine (Object *owner, AsciiString name) | |
| virtual StateReturnType | initDefaultState () |
| StateID | getCurrentStateID () const |
| return the id of the current state of the machine | |
| Bool | isInIdleState () const |
| Bool | isInAttackState () const |
| Bool | isInForceAttackState () const |
| Bool | isInGuardIdleState () const |
| Bool | isInBusyState () const |
| void | lock (const char *msg) |
| void | unlock () |
| Bool | isLocked () const |
| Object * | getOwner () |
| const Object * | getOwner () const |
| void | setGoalObject (const Object *obj) |
| Object * | getGoalObject () |
| const Object * | getGoalObject () const |
| void | setGoalPosition (const Coord3D *pos) |
| const Coord3D * | getGoalPosition () const |
| Bool | isGoalObjectDestroyed () const |
| Returns true if we had a goal object, but it has been destroyed. | |
| virtual void | halt (void) |
| Stops the state machine & disables it in preparation for deleting it. | |
| StateReturnType | internalSetState (StateID newStateID) |
| for internal use only - change the current state of the machine | |
| Bool | getWantsDebugOutput () const |
| AsciiString | getCurrentStateName () const |
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) |
| virtual void | xfer (Xfer *xfer) |
| virtual void | loadPostProcess () |
Protected Member Functions inherited from StateMachine | |
| void | defineState (StateID id, State *state, StateID successID, StateID failureID, const StateConditionInfo *conditions=NULL) |
| State * | internalGetState (StateID id) |
Protected Member Functions inherited from MemoryPoolObject | |
| virtual | ~MemoryPoolObject () |
| void * | operator new (size_t s) |
| void | operator delete (void *p) |
| virtual MemoryPool * | getObjectMemoryPool ()=0 |
The AI state machine. This is used by AIUpdate to implement all of the commands in the AICommandInterface.
NOTE NOTE NOTE NOTE NOTE
Do NOT subclass this unless you want ALL of the states this machine possesses. If you only want SOME of the states, please make a new StateMachine, descended from StateMachine, NOT AIStateMachine. Thank you. (srj)
NOTE NOTE NOTE NOTE NOTE
Definition at line 133 of file AIStateMachine.h.
| AIStateMachine::AIStateMachine | ( | Object * | owner, |
| AsciiString | name ) |
The implementation of this constructor defines the states used by this machine.
Definition at line 677 of file AIStates.cpp.
| void AIStateMachine::addToGoalPath | ( | const Coord3D * | pathPoint | ) |
Add a point to a simple path
Definition at line 980 of file AIStates.cpp.
|
virtual |
clear the machine's internals to a known, initialized state
Clear the machine
Reimplemented from StateMachine.
Definition at line 1025 of file AIStates.cpp.
|
protectedvirtual |
return path position at index "i"
Return path position at index "i"
Definition at line 997 of file AIStates.cpp.
|
inline |
Definition at line 152 of file AIStateMachine.h.
| Squad * AIStateMachine::getGoalSquad | ( | void | ) |
Definition at line 1093 of file AIStates.cpp.
| const Waypoint * AIStateMachine::getGoalWaypoint | ( | ) |
Return the current goal waypoint
Definition at line 1019 of file AIStates.cpp.
|
inline |
Definition at line 166 of file AIStateMachine.h.
|
protectedvirtual |
|
virtual |
clear the machine's internals and set to the default state
Reset the machine to its default state
Reimplemented from StateMachine.
Definition at line 1038 of file AIStates.cpp.
| void AIStateMachine::setGoalAIGroup | ( | const AIGroup * | group | ) |
Definition at line 1083 of file AIStates.cpp.
| void AIStateMachine::setGoalPath | ( | const std::vector< Coord3D > * | path | ) |
Define a simple path
Definition at line 832 of file AIStates.cpp.
| void AIStateMachine::setGoalSquad | ( | const Squad * | squad | ) |
Definition at line 1073 of file AIStates.cpp.
| void AIStateMachine::setGoalTeam | ( | const Team * | team | ) |
Definition at line 1063 of file AIStates.cpp.
| void AIStateMachine::setGoalWaypoint | ( | const Waypoint * | way | ) |
move toward this waypoint, continue if connected
Set the current goal waypoint. If we reach this waypoint and there are connections to further points, continue on.
Definition at line 1010 of file AIStates.cpp.
|
virtual |
change the current state of the machine (which may cause further state changes, due to onEnter)
Change the current state of the machine. This causes the old state's onExit() method to be invoked, and the new state's onEnter() method to be invoked.
Reimplemented from StateMachine.
Definition at line 1050 of file AIStates.cpp.
| StateReturnType AIStateMachine::setTemporaryState | ( | StateID | newStateID, |
| Int | frameLimitCoount ) |
change the temporary state of the machine, and number of frames limit.
Change the temporary state of the machine, and number of frames limit.th
Definition at line 927 of file AIStates.cpp.
|
virtual |
run one step of the machine
Run one step of the machine
Reimplemented from StateMachine.
Definition at line 858 of file AIStates.cpp.
|
protectedvirtual |