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

#include <BridgeBehavior.h>

Inherits UpdateModule, BridgeBehaviorInterface, DamageModuleInterface, and DieModuleInterface.

Public Member Functions

 BridgeBehavior (Thing *thing, const ModuleData *moduleData)
 
virtual BridgeBehaviorInterfacegetBridgeBehaviorInterface (void)
 
virtual void onDelete (void)
 
virtual DamageModuleInterfacegetDamage (void)
 
virtual void onDamage (DamageInfo *damageInfo)
 damage callback
 
virtual void onHealing (DamageInfo *damageInfo)
 healing callback
 
virtual void onBodyDamageStateChange (const DamageInfo *damageInfo, BodyDamageType oldState, BodyDamageType newState)
 state change callback
 
virtual DieModuleInterfacegetDie (void)
 
virtual void onDie (const DamageInfo *damageInfo)
 
virtual UpdateModuleInterfacegetUpdate (void)
 
virtual UpdateSleepTime update (void)
 
virtual void setTower (BridgeTowerType towerType, Object *tower)
 connect tower to us
 
virtual ObjectID getTowerID (BridgeTowerType towerType)
 retrive one of our towers
 
virtual void createScaffolding (void)
 create scaffolding around bridge
 
virtual void removeScaffolding (void)
 remove scaffolding around bridge
 
virtual Bool isScaffoldInMotion (void)
 is scaffold in motion
 
virtual Bool isScaffoldPresent (void)
 
- Public Member Functions inherited from UpdateModule
 UpdateModule (Thing *thing, const ModuleData *moduleData)
 
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 DestroyModuleInterfacegetDestroy ()
 
virtual SpecialPowerModuleInterfacegetSpecialPower ()
 
virtual UpgradeModuleInterfacegetUpgrade ()
 
virtual StealthUpdategetStealth ()
 
virtual SpyVisionUpdategetSpyVisionUpdate ()
 
virtual ParkingPlaceBehaviorInterfacegetParkingPlaceBehaviorInterface ()
 
virtual RebuildHoleBehaviorInterfacegetRebuildHoleBehaviorInterface ()
 
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
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Static Public Member Functions

static Int getInterfaceMask (void)
 
static BridgeBehaviorInterfacegetBridgeBehaviorInterfaceFromObject (Object *obj)
 
- 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)
 

Protected Member Functions

void resolveFX (void)
 
void handleObjectsOnBridgeOnDie (void)
 
void doAreaEffects (TerrainRoadType *bridgeTemplate, Bridge *bridge, const ObjectCreationList *ocl, const FXList *fx)
 
void setScaffoldData (Object *obj, Real *angle, Real *sunkenHeight, const Coord3D *riseToPos, const Coord3D *buildPos, const Coord3D *bridgeCenter)
 
void getRandomSurfacePosition (TerrainRoadType *bridgeTemplate, const BridgeInfo *bridgeInfo, Coord3D *pos)
 
- 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

ObjectID m_towerID [BRIDGE_MAX_TOWERS]
 the towers that are a part of us
 
const ObjectCreationListm_damageToOCL [BODYDAMAGETYPE_COUNT][MAX_BRIDGE_BODY_FX]
 
const FXListm_damageToFX [BODYDAMAGETYPE_COUNT][MAX_BRIDGE_BODY_FX]
 
AudioEventRTS m_damageToSound [BODYDAMAGETYPE_COUNT]
 
const ObjectCreationListm_repairToOCL [BODYDAMAGETYPE_COUNT][MAX_BRIDGE_BODY_FX]
 
const FXListm_repairToFX [BODYDAMAGETYPE_COUNT][MAX_BRIDGE_BODY_FX]
 
AudioEventRTS m_repairToSound [BODYDAMAGETYPE_COUNT]
 
Bool m_fxResolved
 TRUE until we've loaded our fx pointers and sounds.
 
Bool m_scaffoldPresent
 TRUE when we have repair scaffolding visible.
 
ObjectIDList m_scaffoldObjectIDList
 list of scaffold object IDs
 
UnsignedInt m_deathFrame
 frame we died on
 

Detailed Description

Definition at line 117 of file BridgeBehavior.h.

Constructor & Destructor Documentation

◆ BridgeBehavior()

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

Definition at line 229 of file BridgeBehavior.cpp.

Member Function Documentation

◆ createScaffolding()

void BridgeBehavior::createScaffolding ( void )
virtual

create scaffolding around bridge

Start the bridge repair scaffolding. If we already have scaffolding this call is ignored

Implements BridgeBehaviorInterface.

Definition at line 1022 of file BridgeBehavior.cpp.

◆ doAreaEffects()

void BridgeBehavior::doAreaEffects ( TerrainRoadType * bridgeTemplate,
Bridge * bridge,
const ObjectCreationList * ocl,
const FXList * fx )
protected

Definition at line 564 of file BridgeBehavior.cpp.

◆ getBridgeBehaviorInterface()

virtual BridgeBehaviorInterface * BridgeBehavior::getBridgeBehaviorInterface ( void )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 135 of file BridgeBehavior.h.

◆ getBridgeBehaviorInterfaceFromObject()

BridgeBehaviorInterface * BridgeBehavior::getBridgeBehaviorInterfaceFromObject ( Object * obj)
static

Get bridge behavior interface

Definition at line 290 of file BridgeBehavior.cpp.

◆ getDamage()

virtual DamageModuleInterface * BridgeBehavior::getDamage ( void )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 139 of file BridgeBehavior.h.

◆ getDie()

virtual DieModuleInterface * BridgeBehavior::getDie ( void )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 147 of file BridgeBehavior.h.

◆ getInterfaceMask()

static Int BridgeBehavior::getInterfaceMask ( void )
inlinestatic

Definition at line 132 of file BridgeBehavior.h.

◆ getRandomSurfacePosition()

void BridgeBehavior::getRandomSurfacePosition ( TerrainRoadType * bridgeTemplate,
const BridgeInfo * bridgeInfo,
Coord3D * pos )
protected

Pick a random surface spot on the bridge surface

Definition at line 516 of file BridgeBehavior.cpp.

◆ getTowerID()

ObjectID BridgeBehavior::getTowerID ( BridgeTowerType towerType)
virtual

retrive one of our towers

Implements BridgeBehaviorInterface.

Definition at line 414 of file BridgeBehavior.cpp.

◆ getUpdate()

virtual UpdateModuleInterface * BridgeBehavior::getUpdate ( void )
inlinevirtual

Reimplemented from UpdateModule.

Definition at line 151 of file BridgeBehavior.h.

◆ handleObjectsOnBridgeOnDie()

void BridgeBehavior::handleObjectsOnBridgeOnDie ( void )
protected

Definition at line 870 of file BridgeBehavior.cpp.

◆ isScaffoldInMotion()

Bool BridgeBehavior::isScaffoldInMotion ( void )
virtual

is scaffold in motion

Is any of the scaffolding in motion

Implements BridgeBehaviorInterface.

Definition at line 1338 of file BridgeBehavior.cpp.

◆ isScaffoldPresent()

virtual Bool BridgeBehavior::isScaffoldPresent ( void )
inlinevirtual

Implements BridgeBehaviorInterface.

Definition at line 161 of file BridgeBehavior.h.

◆ onBodyDamageStateChange()

void BridgeBehavior::onBodyDamageStateChange ( const DamageInfo * damageInfo,
BodyDamageType oldState,
BodyDamageType newState )
virtual

state change callback

Todo
this should be re-written, there no need for this looping bridge examination

Implements DamageModuleInterface.

Definition at line 611 of file BridgeBehavior.cpp.

◆ onDamage()

void BridgeBehavior::onDamage ( DamageInfo * damageInfo)
virtual

damage callback

Implements DamageModuleInterface.

Definition at line 433 of file BridgeBehavior.cpp.

◆ onDelete()

void BridgeBehavior::onDelete ( void )
virtual

onDelete() will be called on all modules contained by an object or drawable before the actual deletion of each of those modules happens

Reimplemented from Module.

Definition at line 315 of file BridgeBehavior.cpp.

◆ onDie()

void BridgeBehavior::onDie ( const DamageInfo * damageInfo)
virtual

Implements DieModuleInterface.

Definition at line 846 of file BridgeBehavior.cpp.

◆ onHealing()

void BridgeBehavior::onHealing ( DamageInfo * damageInfo)
virtual

healing callback

Implements DamageModuleInterface.

Definition at line 477 of file BridgeBehavior.cpp.

◆ removeScaffolding()

void BridgeBehavior::removeScaffolding ( void )
virtual

remove scaffolding around bridge

Remove the bridge scaffolding. If we don't have any then this call is ignored

Implements BridgeBehaviorInterface.

Definition at line 1286 of file BridgeBehavior.cpp.

◆ resolveFX()

void BridgeBehavior::resolveFX ( void )
protected

Definition at line 325 of file BridgeBehavior.cpp.

◆ setScaffoldData()

void BridgeBehavior::setScaffoldData ( Object * obj,
Real * angle,
Real * sunkenHeight,
const Coord3D * riseToPos,
const Coord3D * buildPos,
const Coord3D * bridgeCenter )
protected

Set all the position, angle, and speed data we need to for a single scaffold object

Definition at line 959 of file BridgeBehavior.cpp.

◆ setTower()

void BridgeBehavior::setTower ( BridgeTowerType towerType,
Object * tower )
virtual

connect tower to us

Implements BridgeBehaviorInterface.

Definition at line 392 of file BridgeBehavior.cpp.

◆ update()

UpdateSleepTime BridgeBehavior::update ( void )
virtual

Implements UpdateModule.

Definition at line 706 of file BridgeBehavior.cpp.

Member Data Documentation

◆ m_damageToFX

const FXList* BridgeBehavior::m_damageToFX[BODYDAMAGETYPE_COUNT][MAX_BRIDGE_BODY_FX]
protected

Definition at line 184 of file BridgeBehavior.h.

◆ m_damageToOCL

const ObjectCreationList* BridgeBehavior::m_damageToOCL[BODYDAMAGETYPE_COUNT][MAX_BRIDGE_BODY_FX]
protected

Definition at line 183 of file BridgeBehavior.h.

◆ m_damageToSound

AudioEventRTS BridgeBehavior::m_damageToSound[BODYDAMAGETYPE_COUNT]
protected

Definition at line 185 of file BridgeBehavior.h.

◆ m_deathFrame

UnsignedInt BridgeBehavior::m_deathFrame
protected

frame we died on

Definition at line 197 of file BridgeBehavior.h.

◆ m_fxResolved

Bool BridgeBehavior::m_fxResolved
protected

TRUE until we've loaded our fx pointers and sounds.

Definition at line 192 of file BridgeBehavior.h.

◆ m_repairToFX

const FXList* BridgeBehavior::m_repairToFX[BODYDAMAGETYPE_COUNT][MAX_BRIDGE_BODY_FX]
protected

Definition at line 189 of file BridgeBehavior.h.

◆ m_repairToOCL

const ObjectCreationList* BridgeBehavior::m_repairToOCL[BODYDAMAGETYPE_COUNT][MAX_BRIDGE_BODY_FX]
protected

Definition at line 188 of file BridgeBehavior.h.

◆ m_repairToSound

AudioEventRTS BridgeBehavior::m_repairToSound[BODYDAMAGETYPE_COUNT]
protected

Definition at line 190 of file BridgeBehavior.h.

◆ m_scaffoldObjectIDList

ObjectIDList BridgeBehavior::m_scaffoldObjectIDList
protected

list of scaffold object IDs

Definition at line 195 of file BridgeBehavior.h.

◆ m_scaffoldPresent

Bool BridgeBehavior::m_scaffoldPresent
protected

TRUE when we have repair scaffolding visible.

Definition at line 194 of file BridgeBehavior.h.

◆ m_towerID

ObjectID BridgeBehavior::m_towerID[BRIDGE_MAX_TOWERS]
protected

the towers that are a part of us

Definition at line 180 of file BridgeBehavior.h.


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