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

#include <DockUpdate.h>

Inherits UpdateModule, and DockUpdateInterface.

Inherited by RailedTransportDockUpdate, RepairDockUpdate, SupplyCenterDockUpdate, and SupplyWarehouseDockUpdate.

Public Member Functions

 DockUpdate (Thing *thing, const ModuleData *moduleData)
 
virtual Bool isClearToApproach (Object const *docker) const
 
virtual Bool reserveApproachPosition (Object *docker, Coord3D *position, Int *index)
 
virtual Bool advanceApproachPosition (Object *docker, Coord3D *position, Int *index)
 
virtual Bool isClearToEnter (Object const *docker) const
 
virtual Bool isClearToAdvance (Object const *docker, Int dockerIndex) const
 
virtual void getEnterPosition (Object *docker, Coord3D *position)
 
virtual void getDockPosition (Object *docker, Coord3D *position)
 
virtual void getExitPosition (Object *docker, Coord3D *position)
 
virtual void onApproachReached (Object *docker)
 I have reached the Approach Point.
 
virtual void onEnterReached (Object *docker)
 I have reached the Enter Point.
 
virtual void onDockReached (Object *docker)
 I have reached the Dock point.
 
virtual void onExitReached (Object *docker)
 I have reached the exit. You are no longer busy.
 
virtual void cancelDock (Object *docker)
 Clear me from any reserved points, and if I was the reason you were Busy, you aren't anymore.
 
virtual Bool isDockOpen (void)
 Is the dock open to accepting dockers.
 
virtual void setDockOpen (Bool open)
 Open/Close the dock.
 
virtual Bool isAllowPassthroughType ()
 Not all docks allow you to path through them in your AIDock machine.
 
virtual Bool isRallyPointAfterDockType ()
 A minority of docks want to give you a final command to their rally point.
 
virtual void setDockCrippled (Bool setting)
 Game Logic can set me as inoperative. I get to decide what that means.
 
virtual UpdateSleepTime update ()
 In charge of lifting dock restriction for one registered as Approached if all is ready.
 
- Public Member Functions inherited from UpdateModule
 UpdateModule (Thing *thing, const ModuleData *moduleData)
 
virtual UpdateModuleInterfacegetUpdate ()
 
DisabledMaskType getDisabledTypesToProcess () const
 
UPDATEMODULE_FRIEND_DECLARATOR UnsignedInt friend_getPriority () const
 
UPDATEMODULE_FRIEND_DECLARATOR UnsignedInt friend_getNextCallFrame () const
 
UPDATEMODULE_FRIEND_DECLARATOR SleepyUpdatePhase friend_getNextCallPhase () const
 
UPDATEMODULE_FRIEND_DECLARATOR void friend_setNextCallFrame (UnsignedInt frame)
 
UPDATEMODULE_FRIEND_DECLARATOR Int friend_getIndexInLogic () const
 
UPDATEMODULE_FRIEND_DECLARATOR void friend_setIndexInLogic (Int i)
 
UPDATEMODULE_FRIEND_DECLARATOR const Objectfriend_getObject () const
 
- Public Member Functions inherited from BehaviorModule
 BehaviorModule (Thing *thing, const ModuleData *moduleData)
 
virtual BodyModuleInterfacegetBody ()
 
virtual CollideModuleInterfacegetCollide ()
 
virtual ContainModuleInterfacegetContain ()
 
virtual CreateModuleInterfacegetCreate ()
 
virtual DamageModuleInterfacegetDamage ()
 
virtual DestroyModuleInterfacegetDestroy ()
 
virtual DieModuleInterfacegetDie ()
 
virtual SpecialPowerModuleInterfacegetSpecialPower ()
 
virtual UpgradeModuleInterfacegetUpgrade ()
 
virtual StealthUpdategetStealth ()
 
virtual SpyVisionUpdategetSpyVisionUpdate ()
 
virtual ParkingPlaceBehaviorInterfacegetParkingPlaceBehaviorInterface ()
 
virtual RebuildHoleBehaviorInterfacegetRebuildHoleBehaviorInterface ()
 
virtual BridgeBehaviorInterfacegetBridgeBehaviorInterface ()
 
virtual BridgeTowerBehaviorInterfacegetBridgeTowerBehaviorInterface ()
 
virtual BridgeScaffoldBehaviorInterfacegetBridgeScaffoldBehaviorInterface ()
 
virtual OverchargeBehaviorInterfacegetOverchargeBehaviorInterface ()
 
virtual TransportPassengerInterfacegetTransportPassengerInterface ()
 
virtual CaveInterfacegetCaveInterface ()
 
virtual LandMineInterfacegetLandMineInterface ()
 
virtual DieModuleInterfacegetEjectPilotDieInterface ()
 
virtual ProjectileUpdateInterfacegetProjectileUpdateInterface ()
 
virtual AIUpdateInterfacegetAIUpdateInterface ()
 
virtual ExitInterfacegetUpdateExitInterface ()
 
virtual DockUpdateInterfacegetDockUpdateInterface ()
 
virtual RailedTransportDockUpdateInterfacegetRailedTransportDockUpdateInterface (void)
 
virtual SlowDeathBehaviorInterfacegetSlowDeathBehaviorInterface ()
 
virtual SpecialPowerUpdateInterfacegetSpecialPowerUpdateInterface ()
 
virtual SlavedUpdateInterfacegetSlavedUpdateInterface ()
 
virtual ProductionUpdateInterfacegetProductionUpdateInterface ()
 
virtual HordeUpdateInterfacegetHordeUpdateInterface ()
 
virtual PowerPlantUpdateInterfacegetPowerPlantUpdateInterface ()
 
virtual SpawnBehaviorInterfacegetSpawnBehaviorInterface ()
 
virtual CountermeasuresBehaviorInterfacegetCountermeasuresBehaviorInterface ()
 
virtual const CountermeasuresBehaviorInterfacegetCountermeasuresBehaviorInterface () const
 
- Public Member Functions inherited from ObjectModule
 ObjectModule (Thing *thing, const ModuleData *moduleData)
 < this abstract class needs memory pool hooks
 
virtual void onCapture (Player *oldOwner, Player *newOwner)
 
virtual void onDisabledEdge (Bool nowDisabled)
 
- Public Member Functions inherited from Module
 Module (const ModuleData *moduleData)
 < this abstract class needs memory pool hooks
 
virtual NameKeyType getModuleNameKey () const =0
 
NameKeyType getModuleTagNameKey () const
 
virtual void onObjectCreated ()
 
virtual void onDrawableBoundToObject ()
 
virtual void preloadAssets (TimeOfDay timeOfDay)
 preload any assets we might have for this time of day
 
virtual void onDelete (void)
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 
- Public Member Functions inherited from DockUpdateInterface
virtual Bool action (Object *docker, Object *drone=NULL)=0
 Perform your specific action on me. Returning FALSE means there is nothing for you to do so I should leave.
 

Protected Member Functions

void loadDockPositions ()
 load all the dock positions
 
Coord3D computeApproachPosition (Int positionIndex, Object *forWhom)
 Do a smart lookup of this bone position.
 
- Protected Member Functions inherited from UpdateModule
void setWakeFrame (Object *obj, UpdateSleepTime wakeDelay)
 
UpdateSleepTime getWakeFrame () const
 
virtual SleepyUpdatePhase getUpdatePhase () const
 
UpdateSleepTime frameToSleepTime (UnsignedInt frame1, UnsignedInt frame2=FOREVER, UnsignedInt frame3=FOREVER, UnsignedInt frame4=FOREVER)
 
- Protected Member Functions inherited from BehaviorModule
virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
- Protected Member Functions inherited from ObjectModule
ObjectgetObject ()
 
const ObjectgetObject () const
 
- Protected Member Functions inherited from Module
const ModuleDatagetModuleData () const
 
- 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_enterPosition
 
Coord3D m_dockPosition
 
Coord3D m_exitPosition
 
Int m_numberApproachPositions
 
Int m_numberApproachPositionBones
 
Bool m_positionsLoaded
 FALSE until we have loaded all the docking positions.
 
VecCoord3D m_approachPositions
 
ObjectIDVector m_approachPositionOwners
 Who is in or at least reserved each spot.
 
BoolVector m_approachPositionReached
 Which positions have actually been reached.
 
ObjectID m_activeDocker
 we could expand this to multiple dock paths since we always get docker in our methods
 
Bool m_dockerInside
 This is true while our active docker is between Enter and Exit. This is shorter than activeDocker's lifetime as it doesn't include approach to enter.
 
Bool m_dockCrippled
 Has game logic set me as crippled?
 
Bool m_dockOpen
 Is the dock open for dockers.
 

Additional Inherited Members

- Static Public Member Functions inherited from UpdateModule
static Int getInterfaceMask ()
 
- Static Public Member Functions inherited from BehaviorModule
static Int getInterfaceMask ()
 
static ModuleType getModuleType ()
 
- Static Public Member Functions inherited from Module
static ModuleDatafriend_newModuleData (INI *ini)
 

Detailed Description

Definition at line 63 of file DockUpdate.h.

Constructor & Destructor Documentation

◆ DockUpdate()

DockUpdate::DockUpdate ( Thing * thing,
const ModuleData * moduleData )

Definition at line 66 of file DockUpdate.cpp.

Member Function Documentation

◆ advanceApproachPosition()

Bool DockUpdate::advanceApproachPosition ( Object * docker,
Coord3D * position,
Int * index )
virtual

Give me the next Queue point to drive to, and record that that point is taken.

Implements DockUpdateInterface.

Definition at line 187 of file DockUpdate.cpp.

◆ cancelDock()

void DockUpdate::cancelDock ( Object * docker)
virtual

Clear me from any reserved points, and if I was the reason you were Busy, you aren't anymore.

Implements DockUpdateInterface.

Definition at line 380 of file DockUpdate.cpp.

◆ computeApproachPosition()

Coord3D DockUpdate::computeApproachPosition ( Int positionIndex,
Object * forWhom )
protected

Do a smart lookup of this bone position.

Definition at line 446 of file DockUpdate.cpp.

◆ getDockPosition()

void DockUpdate::getDockPosition ( Object * docker,
Coord3D * position )
virtual

Give me the middle point of the dock process where the action() happens

Implements DockUpdateInterface.

Definition at line 264 of file DockUpdate.cpp.

◆ getEnterPosition()

void DockUpdate::getEnterPosition ( Object * docker,
Coord3D * position )
virtual

Give me the point that is the start of your docking path Returning NULL means there is none free All functions take docker as arg so we could have multiple docks on a building.
Docker is not assumed, it is recorded and checked.

Implements DockUpdateInterface.

Definition at line 234 of file DockUpdate.cpp.

◆ getExitPosition()

void DockUpdate::getExitPosition ( Object * docker,
Coord3D * position )
virtual

Give me the point to drive to when I am done

Implements DockUpdateInterface.

Definition at line 289 of file DockUpdate.cpp.

◆ isAllowPassthroughType()

Bool DockUpdate::isAllowPassthroughType ( )
virtual

Not all docks allow you to path through them in your AIDock machine.

Implements DockUpdateInterface.

Definition at line 537 of file DockUpdate.cpp.

◆ isClearToAdvance()

Bool DockUpdate::isClearToAdvance ( Object const * docker,
Int dockerIndex ) const
virtual

Return true when it is OK for docker to request a new Approach position. The dock is in charge of keeping track of holes in the line, but the docker will remind us of their spot.

Implements DockUpdateInterface.

Definition at line 221 of file DockUpdate.cpp.

◆ isClearToApproach()

Bool DockUpdate::isClearToApproach ( Object const * docker) const
virtual

Returns true if it is okay for the docker to approach and prepare to dock. False could mean the queue is full, for example.

Implements DockUpdateInterface.

Definition at line 112 of file DockUpdate.cpp.

◆ isClearToEnter()

Bool DockUpdate::isClearToEnter ( Object const * docker) const
virtual

Return true when it is OK for docker to begin entering the dock The Dock will lift the restriction on one particular docker on its own, so you must continually ask.

Implements DockUpdateInterface.

Reimplemented in RailedTransportDockUpdate.

Definition at line 215 of file DockUpdate.cpp.

◆ isDockOpen()

virtual Bool DockUpdate::isDockOpen ( void )
inlinevirtual

Is the dock open to accepting dockers.

Implements DockUpdateInterface.

Definition at line 123 of file DockUpdate.h.

◆ isRallyPointAfterDockType()

virtual Bool DockUpdate::isRallyPointAfterDockType ( )
inlinevirtual

A minority of docks want to give you a final command to their rally point.

Implements DockUpdateInterface.

Reimplemented in RepairDockUpdate.

Definition at line 128 of file DockUpdate.h.

◆ loadDockPositions()

void DockUpdate::loadDockPositions ( )
protected

load all the dock positions

Definition at line 491 of file DockUpdate.cpp.

◆ onApproachReached()

void DockUpdate::onApproachReached ( Object * docker)
virtual

I have reached the Approach Point.

Implements DockUpdateInterface.

Definition at line 314 of file DockUpdate.cpp.

◆ onDockReached()

void DockUpdate::onDockReached ( Object * docker)
virtual

I have reached the Dock point.

Implements DockUpdateInterface.

Definition at line 348 of file DockUpdate.cpp.

◆ onEnterReached()

void DockUpdate::onEnterReached ( Object * docker)
virtual

I have reached the Enter Point.

Implements DockUpdateInterface.

Definition at line 327 of file DockUpdate.cpp.

◆ onExitReached()

void DockUpdate::onExitReached ( Object * docker)
virtual

I have reached the exit. You are no longer busy.

Implements DockUpdateInterface.

Definition at line 355 of file DockUpdate.cpp.

◆ reserveApproachPosition()

Bool DockUpdate::reserveApproachPosition ( Object * docker,
Coord3D * position,
Int * index )
virtual

Give me a Queue point to drive to, and record that that point is taken. Returning NULL means there are none free

Implements DockUpdateInterface.

Definition at line 136 of file DockUpdate.cpp.

◆ setDockCrippled()

void DockUpdate::setDockCrippled ( Bool setting)
virtual

Game Logic can set me as inoperative. I get to decide what that means.

Implements DockUpdateInterface.

Reimplemented in SupplyWarehouseDockUpdate.

Definition at line 409 of file DockUpdate.cpp.

◆ setDockOpen()

virtual void DockUpdate::setDockOpen ( Bool open)
inlinevirtual

Open/Close the dock.

Implements DockUpdateInterface.

Definition at line 124 of file DockUpdate.h.

◆ update()

UpdateSleepTime DockUpdate::update ( void )
virtual

In charge of lifting dock restriction for one registered as Approached if all is ready.

Implements UpdateModule.

Reimplemented in RailedTransportDockUpdate, and SupplyCenterDockUpdate.

Definition at line 415 of file DockUpdate.cpp.

Member Data Documentation

◆ m_activeDocker

ObjectID DockUpdate::m_activeDocker
protected

we could expand this to multiple dock paths since we always get docker in our methods

Definition at line 150 of file DockUpdate.h.

◆ m_approachPositionOwners

ObjectIDVector DockUpdate::m_approachPositionOwners
protected

Who is in or at least reserved each spot.

Definition at line 147 of file DockUpdate.h.

◆ m_approachPositionReached

BoolVector DockUpdate::m_approachPositionReached
protected

Which positions have actually been reached.

Definition at line 148 of file DockUpdate.h.

◆ m_approachPositions

VecCoord3D DockUpdate::m_approachPositions
protected

Definition at line 146 of file DockUpdate.h.

◆ m_dockCrippled

Bool DockUpdate::m_dockCrippled
protected

Has game logic set me as crippled?

Definition at line 152 of file DockUpdate.h.

◆ m_dockerInside

Bool DockUpdate::m_dockerInside
protected

This is true while our active docker is between Enter and Exit. This is shorter than activeDocker's lifetime as it doesn't include approach to enter.

Definition at line 151 of file DockUpdate.h.

◆ m_dockOpen

Bool DockUpdate::m_dockOpen
protected

Is the dock open for dockers.

Definition at line 154 of file DockUpdate.h.

◆ m_dockPosition

Coord3D DockUpdate::m_dockPosition
protected

Definition at line 138 of file DockUpdate.h.

◆ m_enterPosition

Coord3D DockUpdate::m_enterPosition
protected

Definition at line 137 of file DockUpdate.h.

◆ m_exitPosition

Coord3D DockUpdate::m_exitPosition
protected

Definition at line 139 of file DockUpdate.h.

◆ m_numberApproachPositionBones

Int DockUpdate::m_numberApproachPositionBones
protected

Definition at line 141 of file DockUpdate.h.

◆ m_numberApproachPositions

Int DockUpdate::m_numberApproachPositions
protected

Definition at line 140 of file DockUpdate.h.

◆ m_positionsLoaded

Bool DockUpdate::m_positionsLoaded
protected

FALSE until we have loaded all the docking positions.

Definition at line 144 of file DockUpdate.h.


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