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

#include <TunnelContain.h>

Inherits OpenContain, and CreateModuleInterface.

Public Member Functions

 TunnelContain (Thing *thing, const ModuleData *moduleData)
 
virtual CreateModuleInterfacegetCreate ()
 
virtual OpenContainasOpenContain ()
 treat as open container
 
virtual Bool isGarrisonable () const
 can this unit be Garrisoned? (ick)
 
virtual Bool isBustable () const
 can this container get busted by a bunkerbuster
 
virtual Bool isHealContain () const
 true when container only contains units while healing (not a transport!)
 
virtual Bool isTunnelContain () const
 
virtual Bool isImmuneToClearBuildingAttacks () const
 
virtual Bool isSpecialOverlordStyleContainer () const
 
virtual void onContaining (Object *obj, Bool wasSelected)
 object now contains 'obj'
 
virtual void onRemoving (Object *obj)
 object no longer contains 'obj'
 
virtual void onSelling ()
 Container is being sold. Tunnel responds by kicking people out if this is the last tunnel.
 
virtual void onCapture (Player *oldOwner, Player *newOwner)
 
virtual Bool isValidContainerFor (const Object *obj, Bool checkCapacity) const
 
virtual void addToContainList (Object *obj)
 The part of AddToContain that inheritors can override (Can't do whole thing because of all the private stuff involved)
 
virtual void removeFromContain (Object *obj, Bool exposeStealthUnits=FALSE)
 remove 'obj' from contain list
 
virtual void removeAllContained (Bool exposeStealthUnits=FALSE)
 remove all objects on contain list
 
virtual void harmAndForceExitAllContained (DamageInfo *info)
 
virtual void killAllContained (void)
 kill all objects on contain list
 
virtual void iterateContained (ContainIterateFunc func, void *userData, Bool reverse)
 
virtual UnsignedInt getContainCount () const
 contained count
 
virtual Int getContainMax (void) const
 The max needs to be virtual, but only two inheritors care. -1 means "I don't care".
 
virtual const ContainedItemsListgetContainedItemsList () const
 
virtual Bool isDisplayedOnControlBar () const
 Does this container display its contents on the ControlBar?
 
virtual Bool isKickOutOnCapture ()
 Caves and Tunnels don't kick out on capture.
 
virtual void onDie (const DamageInfo *damageInfo)
 the die callback
 
virtual void onDelete (void)
 Last possible moment cleanup.
 
virtual void onCreate (void)
 This is called when you become a code Object.
 
virtual void onObjectCreated ()
 
virtual void onBuildComplete ()
 This is called when you are a finished game object.
 
virtual Bool shouldDoOnBuildComplete () const
 
virtual UpdateSleepTime update ()
 called once per frame
 
- Public Member Functions inherited from OpenContain
 OpenContain (Thing *thing, const ModuleData *moduleData)
 
virtual ContainModuleInterfacegetContain ()
 
virtual CollideModuleInterfacegetCollide ()
 
virtual DieModuleInterfacegetDie ()
 
virtual DamageModuleInterfacegetDamage ()
 
virtual void onCollide (Object *other, const Coord3D *loc, const Coord3D *normal)
 
virtual Bool wouldLikeToCollideWith (const Object *other) const
 
virtual Bool isCarBombCrateCollide () const
 
virtual Bool isHijackedVehicleCrateCollide () const
 
virtual Bool isRailroad () const
 
virtual Bool isSalvageCrateCollide () const
 
virtual Bool isSabotageBuildingCrateCollide () const
 
virtual void onDamage (DamageInfo *damageInfo)
 damage callback
 
virtual void onHealing (DamageInfo *damageInfo)
 damage callback
 
virtual void onBodyDamageStateChange (const DamageInfo *damageInfo, BodyDamageType oldState, BodyDamageType newState)
 healing callback
 
virtual void containReactToTransformChange ()
 state change callback
 
virtual Bool calcBestGarrisonPosition (Coord3D *sourcePos, const Coord3D *targetPos)
 
virtual Bool attemptBestFirePointPosition (Object *source, Weapon *weapon, Object *victim)
 
virtual Bool attemptBestFirePointPosition (Object *source, Weapon *weapon, const Coord3D *targetPos)
 
virtual void clientVisibleContainedFlashAsSelected ()
 
virtual const PlayergetApparentControllingPlayer (const Player *observingPlayer) const
 
virtual void recalcApparentControllingPlayer ()
 
virtual void orderAllPassengersToExit (CommandSourceType commandSource, Bool instantly)
 All of the smarts of exiting are in the passenger's AIExit. removeAllFrommContain is a last ditch system call, this is the game Evacuate.
 
virtual void orderAllPassengersToIdle (CommandSourceType commandSource)
 Just like it sounds.
 
virtual void orderAllPassengersToHackInternet (CommandSourceType)
 Just like it sounds.
 
virtual void markAllPassengersDetected ()
 Cool game stuff got added to the system calls since this layer didn't exist, so this regains that functionality.
 
virtual void addToContain (Object *obj)
 add 'obj' to contain list
 
virtual Bool isEnclosingContainerFor (const Object *obj) const
 Does this type of Contain Visibly enclose its contents?
 
virtual Bool isPassengerAllowedToFire (ObjectID id=INVALID_ID) const
 Hey, can I shoot out of this container?
 
virtual void setPassengerAllowedToFire (Bool permission=TRUE)
 Hey, can I shoot out of this container?
 
virtual void setOverrideDestination (const Coord3D *)
 Instead of falling peacefully towards a clear spot, I will now aim here.
 
virtual Int getExtraSlotsInUse (void)
 
virtual const Objectfriend_getRider () const
 Damn. The draw order dependency bug for riders means that our draw module needs to cheat to get around it.
 
virtual Real getContainedItemsMass () const
 
virtual UnsignedInt getStealthUnitsContained () const
 
virtual PlayerMaskType getPlayerWhoEntered (void) const
 
virtual Bool isExitBusy () const
 Contain style exiters are getting the ability to space out exits, so ask this before reserveDoor as a kind of no-commitment check.
 
virtual ExitDoorType reserveDoorForExit (const ThingTemplate *objType, Object *specificObject)
 All types can answer if they are free to exit or not, and you can ask about a specific guy or just exit anything in general.
 
virtual void exitObjectViaDoor (Object *newObj, ExitDoorType exitDoor)
 
virtual void exitObjectInAHurry (Object *newObj)
 
virtual void unreserveDoorForExit (ExitDoorType exitDoor)
 if you get permission to exit, but then don't/can't call exitObjectViaDoor, you should call this to "give up" your permission
 
virtual void exitObjectByBudding (Object *newObj, Object *budHost)
 puts new spawn on top of an existing one
 
virtual void setRallyPoint (const Coord3D *pos)
 define a "rally point" for units to move towards
 
virtual const Coord3DgetRallyPoint (void) const
 define a "rally point" for units to move towards
 
virtual Bool getExitPosition (Coord3D &exitPosition) const
 
virtual Bool getNaturalRallyPoint (Coord3D &rallyPoint, Bool offset=TRUE) const
 access to the "Door" position of the production object
 
virtual ExitInterfacegetContainExitInterface ()
 
virtual Bool isRiderChangeContain () const
 
virtual Bool isSpecialZeroSlotContainer () const
 
virtual Bool isAnyRiderAttacking (void) const
 
virtual void onObjectWantsToEnterOrExit (Object *obj, ObjectEnterExitType wants)
 
virtual Bool hasObjectsWantingToEnterOrExit () const
 
virtual void processDamageToContained (Real percentDamage)
 Do our % damage to units now.
 
virtual Bool isWeaponBonusPassedToPassengers () const
 
virtual WeaponBonusConditionFlags getWeaponBonusPassedToPassengers () const
 
virtual void enableLoadSounds (Bool enable)
 
Real getDamagePercentageToUnits (void)
 
virtual ObjectgetClosestRider (const Coord3D *pos)
 
virtual void setEvacDisposition (EvacDisposition disp)
 
- 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 DestroyModuleInterfacegetDestroy ()
 
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 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 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)
 
- Public Member Functions inherited from ContainModuleInterface
virtual Bool getContainerPipsToShow (Int &numTotal, Int &numFull)
 
- Public Member Functions inherited from ExitInterface
virtual Bool useSpawnRallyPoint (void) const
 

Static Public Member Functions

static Int getInterfaceMask ()
 
- Static Public Member Functions inherited from OpenContain
static Int getInterfaceMask ()
 
- 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 scatterToNearbyPosition (Object *obj)
 
- Protected Member Functions inherited from OpenContain
virtual void monitorConditionChanges (void)
 check to see if we need to update our occupant postions from a model change or anything else
 
virtual void putObjAtNextFirePoint (Object *obj)
 place object at position of the next fire point to use
 
virtual void redeployOccupants (void)
 redeploy any objects at firepoints due to a model condition change
 
const ContainedItemsListgetContainList () const
 
void scatterToNearbyPosition (Object *obj)
 
void removeFromContainViaIterator (ContainedItemsList::iterator it, Bool exposeStealthUnits=FALSE)
 remove item from contain list
 
void removeFromPassengerViaIterator (ContainedItemsList::iterator it)
 remove item from passenger list
 
virtual void doLoadSound ()
 
virtual void doUnloadSound ()
 
virtual void positionContainedObjectsRelativeToContainer ()
 
virtual void addOrRemoveObjFromWorld (Object *obj, Bool add)
 
virtual void killRidersWhoAreNotFreeToExit ()
 
void pruneDeadWanters ()
 
- 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

Bool m_needToRunOnBuildComplete
 
Bool m_isCurrentlyRegistered
 Keeps track if this is registered with the player, so we don't double remove and mess up.
 
- Protected Attributes inherited from OpenContain
ContainedItemsList m_containList
 the list of contained objects
 
UnsignedInt m_containListSize
 size of contained list
 

Detailed Description

Definition at line 78 of file TunnelContain.h.

Constructor & Destructor Documentation

◆ TunnelContain()

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

Definition at line 58 of file TunnelContain.cpp.

Member Function Documentation

◆ addToContainList()

void TunnelContain::addToContainList ( Object * obj)
virtual

The part of AddToContain that inheritors can override (Can't do whole thing because of all the private stuff involved)

Reimplemented from OpenContain.

Definition at line 70 of file TunnelContain.cpp.

◆ asOpenContain()

virtual OpenContain * TunnelContain::asOpenContain ( )
inlinevirtual

treat as open container

Reimplemented from OpenContain.

Definition at line 92 of file TunnelContain.h.

◆ getContainCount()

UnsignedInt TunnelContain::getContainCount ( ) const
virtual

contained count

Reimplemented from OpenContain.

Definition at line 267 of file TunnelContain.cpp.

◆ getContainedItemsList()

const ContainedItemsList * TunnelContain::getContainedItemsList ( ) const
virtual

Reimplemented from OpenContain.

Definition at line 283 of file TunnelContain.cpp.

◆ getContainMax()

Int TunnelContain::getContainMax ( void ) const
virtual

The max needs to be virtual, but only two inheritors care. -1 means "I don't care".

Reimplemented from OpenContain.

Definition at line 277 of file TunnelContain.cpp.

◆ getCreate()

virtual CreateModuleInterface * TunnelContain::getCreate ( )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 89 of file TunnelContain.h.

◆ getInterfaceMask()

static Int TunnelContain::getInterfaceMask ( void )
inlinestatic

Definition at line 90 of file TunnelContain.h.

◆ harmAndForceExitAllContained()

void TunnelContain::harmAndForceExitAllContained ( DamageInfo * info)
virtual

Force all contained objects in the contained list to exit, and kick them in the pants on the way out

Reimplemented from OpenContain.

Definition at line 119 of file TunnelContain.cpp.

◆ isBustable()

virtual Bool TunnelContain::isBustable ( ) const
inlinevirtual

can this container get busted by a bunkerbuster

Reimplemented from OpenContain.

Definition at line 94 of file TunnelContain.h.

◆ isDisplayedOnControlBar()

virtual Bool TunnelContain::isDisplayedOnControlBar ( ) const
inlinevirtual

Does this container display its contents on the ControlBar?

Reimplemented from OpenContain.

Definition at line 117 of file TunnelContain.h.

◆ isGarrisonable()

virtual Bool TunnelContain::isGarrisonable ( ) const
inlinevirtual

can this unit be Garrisoned? (ick)

Reimplemented from OpenContain.

Definition at line 93 of file TunnelContain.h.

◆ isHealContain()

virtual Bool TunnelContain::isHealContain ( ) const
inlinevirtual

true when container only contains units while healing (not a transport!)

Reimplemented from OpenContain.

Definition at line 95 of file TunnelContain.h.

◆ isImmuneToClearBuildingAttacks()

virtual Bool TunnelContain::isImmuneToClearBuildingAttacks ( ) const
inlinevirtual

Reimplemented from OpenContain.

Definition at line 97 of file TunnelContain.h.

◆ isKickOutOnCapture()

virtual Bool TunnelContain::isKickOutOnCapture ( )
inlinevirtual

Caves and Tunnels don't kick out on capture.

Reimplemented from OpenContain.

Definition at line 118 of file TunnelContain.h.

◆ isSpecialOverlordStyleContainer()

virtual Bool TunnelContain::isSpecialOverlordStyleContainer ( ) const
inlinevirtual

Reimplemented from OpenContain.

Definition at line 98 of file TunnelContain.h.

◆ isTunnelContain()

virtual Bool TunnelContain::isTunnelContain ( ) const
inlinevirtual

Reimplemented from OpenContain.

Definition at line 96 of file TunnelContain.h.

◆ isValidContainerFor()

Bool TunnelContain::isValidContainerFor ( const Object * obj,
Bool checkCapacity ) const
virtual

Check to see if we are a valid container for 'obj'

Reimplemented from OpenContain.

Definition at line 261 of file TunnelContain.cpp.

◆ iterateContained()

void TunnelContain::iterateContained ( ContainIterateFunc func,
void * userData,
Bool reverse )
virtual

Iterate the contained list and call the callback on each of the objects

Reimplemented from OpenContain.

Definition at line 188 of file TunnelContain.cpp.

◆ killAllContained()

void TunnelContain::killAllContained ( void )
virtual

kill all objects on contain list

Remove all contained objects from the contained list

Reimplemented from OpenContain.

Definition at line 150 of file TunnelContain.cpp.

◆ onBuildComplete()

void TunnelContain::onBuildComplete ( )
virtual

This is called when you are a finished game object.

Implements CreateModuleInterface.

Definition at line 416 of file TunnelContain.cpp.

◆ onCapture()

void TunnelContain::onCapture ( Player * oldOwner,
Player * newOwner )
virtual

Reimplemented from OpenContain.

Definition at line 440 of file TunnelContain.cpp.

◆ onContaining()

void TunnelContain::onContaining ( Object * obj,
Bool wasSelected )
virtual

object now contains 'obj'

Reimplemented from OpenContain.

Definition at line 195 of file TunnelContain.cpp.

◆ onCreate()

void TunnelContain::onCreate ( void )
virtual

This is called when you become a code Object.

Implements CreateModuleInterface.

Definition at line 390 of file TunnelContain.cpp.

◆ onDelete()

void TunnelContain::onDelete ( void )
virtual

Last possible moment cleanup.

Reimplemented from OpenContain.

Definition at line 371 of file TunnelContain.cpp.

◆ onDie()

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

the die callback

The die callback.

Reimplemented from OpenContain.

Definition at line 350 of file TunnelContain.cpp.

◆ onObjectCreated()

void TunnelContain::onObjectCreated ( void )
virtual

this is called after all the Modules for a given Thing are created; it allows Modules to resolve any inter-Module dependencies.

Reimplemented from Module.

Definition at line 395 of file TunnelContain.cpp.

◆ onRemoving()

void TunnelContain::onRemoving ( Object * obj)
virtual

object no longer contains 'obj'

place the object in the world at position of the container m_object

Reimplemented from OpenContain.

Definition at line 213 of file TunnelContain.cpp.

◆ onSelling()

void TunnelContain::onSelling ( void )
virtual

Container is being sold. Tunnel responds by kicking people out if this is the last tunnel.

Reimplemented from OpenContain.

Definition at line 235 of file TunnelContain.cpp.

◆ removeAllContained()

void TunnelContain::removeAllContained ( Bool exposeStealthUnits = FALSE)
virtual

remove all objects on contain list

Remove all contained objects from the contained list

Reimplemented from OpenContain.

Definition at line 169 of file TunnelContain.cpp.

◆ removeFromContain()

void TunnelContain::removeFromContain ( Object * obj,
Bool exposeStealthUnits = FALSE )
virtual

remove 'obj' from contain list

Remove 'obj' from the m_containList of objects in this module. This will trigger an onRemoving event for the object that this module is a part of and an onRemovedFrom event for the object being removed

Reimplemented from OpenContain.

Definition at line 81 of file TunnelContain.cpp.

◆ scatterToNearbyPosition()

void TunnelContain::scatterToNearbyPosition ( Object * obj)
protected

Definition at line 297 of file TunnelContain.cpp.

◆ shouldDoOnBuildComplete()

virtual Bool TunnelContain::shouldDoOnBuildComplete ( ) const
inlinevirtual

Implements CreateModuleInterface.

Definition at line 127 of file TunnelContain.h.

◆ update()

UpdateSleepTime TunnelContain::update ( void )
virtual

called once per frame

Per frame update

Reimplemented from OpenContain.

Definition at line 465 of file TunnelContain.cpp.

Member Data Documentation

◆ m_isCurrentlyRegistered

Bool TunnelContain::m_isCurrentlyRegistered
protected

Keeps track if this is registered with the player, so we don't double remove and mess up.

Definition at line 136 of file TunnelContain.h.

◆ m_needToRunOnBuildComplete

Bool TunnelContain::m_needToRunOnBuildComplete
protected

Definition at line 135 of file TunnelContain.h.


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