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

#include <AIStateMachine.h>

Inherits State.

Inherited by AIAttackApproachTargetState, AIAttackPursueTargetState, AIDockAdvancePositionState, AIDockApproachState, AIDockMoveToDockState, AIDockMoveToEntryState, AIDockMoveToExitState, AIDockMoveToRallyState, AIEnterState, AIFollowPathState, AIFollowWaypointPathExactState, AIFollowWaypointPathState, AIGuardRetaliateReturnState, AIGuardReturnState, AIMoveAndDeleteState, AIMoveAndEvacuateState, AIMoveAndTightenState, AIMoveOutOfTheWayState, AIMoveToState, AIPickUpCrateState, AIWanderInPlaceState, JetOrHeliReturnForLandingState, and JetOrHeliReturningToDeadAirfieldState.

Public Member Functions

 AIInternalMoveToState (StateMachine *machine, AsciiString name)
 
virtual StateReturnType onEnter ()
 
virtual void onExit (StateExitType status)
 
virtual StateReturnType update ()
 
- 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

void setAdjustsDestination (Bool b)
 
Bool getAdjustsDestination () const
 
void setGoalPos (const Coord3D *pos)
 
const Coord3DgetGoalPos () const
 
virtual Bool computePath ()
 compute the path
 
void forceRepath ()
 
virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess ()
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Protected Attributes

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

Basic pathfinding and moving to a goal position. Not for direct use (hence no associated state ID), but for deriving from.

Definition at line 253 of file AIStateMachine.h.

Constructor & Destructor Documentation

◆ AIInternalMoveToState()

AIInternalMoveToState::AIInternalMoveToState ( StateMachine * machine,
AsciiString name )
inline

Definition at line 257 of file AIStateMachine.h.

Member Function Documentation

◆ computePath()

Bool AIInternalMoveToState::computePath ( )
protectedvirtual

compute the path

(Re)compute a path to the goal position, if we are on our own, or we are the leader of a group.

Reimplemented in AIAttackApproachTargetState, AIAttackPursueTargetState, AIMoveAndTightenState, AIMoveAwayFromRepulsorsState, AIMoveOutOfTheWayState, and AIPickUpCrateState.

Definition at line 1601 of file AIStates.cpp.

◆ crc()

◆ forceRepath()

void AIInternalMoveToState::forceRepath ( )
inlineprotected

Definition at line 281 of file AIStateMachine.h.

◆ getAdjustsDestination()

Bool AIInternalMoveToState::getAdjustsDestination ( ) const
protected

Definition at line 1584 of file AIStates.cpp.

◆ getGoalPos()

const Coord3D * AIInternalMoveToState::getGoalPos ( ) const
inlineprotected

Definition at line 277 of file AIStateMachine.h.

◆ loadPostProcess()

◆ onEnter()

◆ onExit()

◆ setAdjustsDestination()

void AIInternalMoveToState::setAdjustsDestination ( Bool b)
inlineprotected

Definition at line 273 of file AIStateMachine.h.

◆ setGoalPos()

void AIInternalMoveToState::setGoalPos ( const Coord3D * pos)
inlineprotected

Definition at line 276 of file AIStateMachine.h.

◆ update()

◆ xfer()

Member Data Documentation

◆ m_goalLayer

PathfindLayerEnum AIInternalMoveToState::m_goalLayer
protected

The layer we are moving towards.

Definition at line 300 of file AIStateMachine.h.

◆ m_goalPosition

Coord3D AIInternalMoveToState::m_goalPosition
protected

the goal position to move to

Definition at line 299 of file AIStateMachine.h.

◆ m_pathGoalPosition

Coord3D AIInternalMoveToState::m_pathGoalPosition
protected

the position our current path leads to

Definition at line 301 of file AIStateMachine.h.

◆ m_tryOneMoreRepath

Bool AIInternalMoveToState::m_tryOneMoreRepath
protected

If true, after we complete movement do another compute path.

Definition at line 310 of file AIStateMachine.h.

◆ m_waitingForPath

Bool AIInternalMoveToState::m_waitingForPath
protected

If we are waiting for a path.

Definition at line 309 of file AIStateMachine.h.


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