Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
TurretStateMachine Class Reference

#include <TurretAI.h>

Inherits StateMachine.

Public Member Functions

 TurretStateMachine (TurretAI *tai, Object *owner, AsciiString name)
 
TurretAIgetTurretAI () const
 
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)
 
- Public Member Functions inherited from StateMachine
 StateMachine (Object *owner, AsciiString name)
 
virtual StateReturnType updateStateMachine ()
 run one step of the machine
 
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
 
ObjectgetOwner ()
 
const ObjectgetOwner () const
 
void setGoalObject (const Object *obj)
 
ObjectgetGoalObject ()
 
const ObjectgetGoalObject () const
 
void setGoalPosition (const Coord3D *pos)
 
const Coord3DgetGoalPosition () 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)
 
StateinternalGetState (StateID id)
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Detailed Description

The AI state machine. This is used by AIUpdate to implement all of the commands in the AICommandInterface.

Definition at line 66 of file TurretAI.h.

Constructor & Destructor Documentation

◆ TurretStateMachine()

TurretStateMachine::TurretStateMachine ( TurretAI * tai,
Object * obj,
AsciiString name )

The implementation of this constructor defines the states used by this machine.

Create a TurretAI state machine. Define all of the states the machine can possibly be in, and set the initial (default) state.

Definition at line 89 of file TurretAI.cpp.

Member Function Documentation

◆ clear()

void TurretStateMachine::clear ( )
virtual

clear the machine's internals to a known, initialized state

Clear the machine

Reimplemented from StateMachine.

Definition at line 112 of file TurretAI.cpp.

◆ crc()

void TurretStateMachine::crc ( Xfer * xfer)
protectedvirtual

CRC

Reimplemented from StateMachine.

Definition at line 149 of file TurretAI.cpp.

◆ getTurretAI()

TurretAI * TurretStateMachine::getTurretAI ( ) const
inline

Definition at line 77 of file TurretAI.h.

◆ loadPostProcess()

void TurretStateMachine::loadPostProcess ( void )
protectedvirtual

Load post process

Reimplemented from StateMachine.

Definition at line 167 of file TurretAI.cpp.

◆ resetToDefaultState()

StateReturnType TurretStateMachine::resetToDefaultState ( )
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 122 of file TurretAI.cpp.

◆ setState()

StateReturnType TurretStateMachine::setState ( StateID newStateID)
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 134 of file TurretAI.cpp.

◆ xfer()

void TurretStateMachine::xfer ( Xfer * xfer)
protectedvirtual

Xfer Method

Reimplemented from StateMachine.

Definition at line 156 of file TurretAI.cpp.


The documentation for this class was generated from the following files: