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

#include <AIStateMachine.h>

Inherits AIFollowWaypointPathState.

Public Member Functions

 AIWanderState (StateMachine *machine)
 
virtual StateReturnType onEnter ()
 
virtual void onExit (StateExitType status)
 
virtual StateReturnType update ()
 
- Public Member Functions inherited from AIFollowWaypointPathState
 AIFollowWaypointPathState (StateMachine *machine, Bool asGroup)
 
 AIFollowWaypointPathState (StateMachine *machine, Bool asGroup, Bool isFollow)
 
- Public Member Functions inherited from AIInternalMoveToState
 AIInternalMoveToState (StateMachine *machine, AsciiString name)
 
- Public Member Functions inherited from State
 State (StateMachine *machine, AsciiString name)
 < this abstract class needs memory pool hooks
 
virtual Bool isIdle () const
 
virtual Bool isAttack () const
 
virtual Bool isGuardIdle () const
 
virtual Bool isBusy () const
 
StateMachinegetMachine ()
 return the machine this state is part of
 
StateID getID () const
 get this state's id
 
ObjectgetMachineOwner ()
 
const ObjectgetMachineOwner () const
 
ObjectgetMachineGoalObject ()
 return the machine this state is part of
 
const ObjectgetMachineGoalObject () const
 return the machine this state is part of
 
const Coord3DgetMachineGoalPosition () 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)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess ()
 
- Protected Member Functions inherited from AIFollowWaypointPathState
void computeGoal (Bool useGroupOffsets)
 
Real calcExtraPathDistance (void)
 
const WaypointgetNextWaypoint (void)
 
Bool hasNextWaypoint (void)
 
- Protected Member Functions inherited from AIInternalMoveToState
void setAdjustsDestination (Bool b)
 
Bool getAdjustsDestination () const
 
void setGoalPos (const Coord3D *pos)
 
const Coord3DgetGoalPos () const
 
virtual Bool computePath ()
 compute the path
 
void forceRepath ()
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Protected Attributes

Int m_waitFrames
 
Int m_timer
 
- Protected Attributes inherited from AIFollowWaypointPathState
Coord2D m_groupOffset
 
Real m_angle
 
Int m_framesSleeping
 
const Waypointm_currentWaypoint
 
const Waypointm_priorWaypoint
 
Bool m_appendGoalPosition
 
const Bool m_moveAsGroup
 
const Bool m_isFollowWaypointPathState
 
- Protected Attributes inherited from AIInternalMoveToState
Coord3D m_goalPosition
 the goal position to move to
 
PathfindLayerEnum m_goalLayer
 The layer we are moving towards.
 
Coord3D m_pathGoalPosition
 the position our current path leads to
 
Bool m_waitingForPath
 If we are waiting for a path.
 
Bool m_tryOneMoreRepath
 If true, after we complete movement do another compute path.
 

Detailed Description

Wanders around following a waypoint path.

Definition at line 716 of file AIStateMachine.h.

Constructor & Destructor Documentation

◆ AIWanderState()

AIWanderState::AIWanderState ( StateMachine * machine)
inline

Definition at line 720 of file AIStateMachine.h.

Member Function Documentation

◆ crc()

void AIWanderState::crc ( Xfer * xfer)
protectedvirtual

Wander along a waypoint path. CRC

Reimplemented from AIFollowWaypointPathState.

Definition at line 4519 of file AIStates.cpp.

◆ loadPostProcess()

void AIWanderState::loadPostProcess ( void )
protectedvirtual

Load post process

Reimplemented from AIFollowWaypointPathState.

Definition at line 4543 of file AIStates.cpp.

◆ onEnter()

StateReturnType AIWanderState::onEnter ( void )
virtual

We are initiating a moveTo action. Pathfind from m_goalPosition to goal.

Reimplemented from AIFollowWaypointPathState.

Definition at line 4550 of file AIStates.cpp.

◆ onExit()

void AIWanderState::onExit ( StateExitType status)
virtual

We are leaving the moveTo state.

Reimplemented from AIFollowWaypointPathState.

Definition at line 4622 of file AIStates.cpp.

◆ update()

StateReturnType AIWanderState::update ( void )
virtual

Execute the moveTo behavior towards GoalPosition.

Trigger "end of waypoint path" scripts (jba)

Trigger "end of waypoint path" scripts (jba)

Todo
srj – find a way to sleep for a number of frames here, if possible

Reimplemented from AIFollowWaypointPathState.

Definition at line 4577 of file AIStates.cpp.

◆ xfer()

void AIWanderState::xfer ( Xfer * xfer)
protectedvirtual

Xfer Method

Reimplemented from AIFollowWaypointPathState.

Definition at line 4527 of file AIStates.cpp.

Member Data Documentation

◆ m_timer

Int AIWanderState::m_timer
protected

Definition at line 740 of file AIStateMachine.h.

◆ m_waitFrames

Int AIWanderState::m_waitFrames
protected

Definition at line 739 of file AIStateMachine.h.


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