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

#include <GarrisonContain.h>

Inherits OpenContain.

Public Member Functions

 GarrisonContain (Thing *thing, const ModuleData *moduleData)
 
virtual UpdateSleepTime update (void)
 called once per frame
 
virtual Bool isValidContainerFor (const Object *obj, Bool checkCapacity) const
 
virtual Bool isGarrisonable () const
 can this unit be Garrisoned? (ick)
 
virtual Bool isBustable () const
 can this container get busted by a bunkerbuster
 
virtual Bool isImmuneToClearBuildingAttacks () const
 
virtual Bool isHealContain () const
 true when container only contains units while healing (not a transport!)
 
virtual Bool isTunnelContain () const
 
virtual Bool isPassengerAllowedToFire (ObjectID id=INVALID_ID) const
 Hey, can I shoot out of this container?
 
virtual Bool isEnclosingContainerFor (const Object *obj) const
 Does this type of Contain Visibly enclose its contents?
 
virtual Bool isSpecialOverlordStyleContainer () const
 
virtual void removeAllContained (Bool exposeStealthUnits)
 remove all contents of this open container
 
virtual void exitObjectViaDoor (Object *exitObj, ExitDoorType exitDoor)
 exit one of our content items from us
 
virtual void exitObjectByBudding (Object *newObj, Object *budHost)
 puts new spawn on top of an existing one
 
virtual void onContaining (Object *obj, Bool wasSelected)
 object now contains 'obj'
 
virtual void onRemoving (Object *obj)
 object no longer contains 'obj'
 
virtual void onSelling (void)
 Container is being sold. Open responds by kicking people out.
 
virtual void onBodyDamageStateChange (const DamageInfo *damageInfo, BodyDamageType oldState, BodyDamageType newState)
 Die Interface state change callback.
 
virtual const PlayergetApparentControllingPlayer (const Player *observingPlayer) const
 
virtual void recalcApparentControllingPlayer (void)
 
virtual Bool isDisplayedOnControlBar () const
 Does this container display its contents on the ControlBar?
 
virtual void onDamage (DamageInfo *info)
 
virtual void setEvacDisposition (EvacDisposition disp)
 
- Public Member Functions inherited from OpenContain
 OpenContain (Thing *thing, const ModuleData *moduleData)
 
virtual ContainModuleInterfacegetContain ()
 
virtual CollideModuleInterfacegetCollide ()
 
virtual DieModuleInterfacegetDie ()
 
virtual DamageModuleInterfacegetDamage ()
 
virtual void onDie (const DamageInfo *damageInfo)
 the die callback
 
virtual void onDelete (void)
 Last possible moment cleanup.
 
virtual void onCapture (Player *oldOwner, Player *newOwner)
 
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 OpenContainasOpenContain ()
 treat as open container
 
virtual void onHealing (DamageInfo *damageInfo)
 damage callback
 
virtual void containReactToTransformChange ()
 state change callback
 
virtual void clientVisibleContainedFlashAsSelected ()
 
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 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 killAllContained (void)
 kill all objects on contain list
 
virtual void harmAndForceExitAllContained (DamageInfo *info)
 
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 Bool isKickOutOnCapture ()
 By default, yes, all contain modules kick passengers out on capture.
 
virtual void iterateContained (ContainIterateFunc func, void *userData, Bool reverse)
 
virtual UnsignedInt getContainCount () const
 contained count
 
virtual const ContainedItemsListgetContainedItemsList () const
 
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 Int getContainMax () const
 The max needs to be virtual, but only two inheritors care. -1 means "I don't care".
 
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 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 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)
 
- 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 CreateModuleInterfacegetCreate ()
 
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
 

Protected Types

enum  { SEARCH_FOR_REMOVE = -1 }
 
enum  { GARRISON_INDEX_INVALID = -1 }
 

Protected Member Functions

virtual void redeployOccupants (void)
 redeploy the occupants of us at all available garrison points
 
virtual void onObjectCreated ()
 
void validateRallyPoint (void)
 validate (if necessary) and pick (if possible) an exit rally point
 
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)
 
void updateEffects (void)
 do any effects needed per frame
 
void loadGarrisonPoints (void)
 load garrison point position data and save for later
 
void putObjectAtBestGarrisonPoint (Object *obj, Object *target, const Coord3D *targetPos)
 place object at position of the best garrison point to use for its target
 
void putObjectAtGarrisonPoint (Object *obj, ObjectID targetID, Int conditionIndex, Int index)
 place object at the specified garrison point index
 
void removeObjectFromGarrisonPoint (Object *obj, Int index=SEARCH_FOR_REMOVE)
 remove object from the garrison point placement
 
void addValidObjectsToGarrisonPoints (void)
 add any objects with targets to a garrison point
 
void removeInvalidObjectsFromGarrisonPoints (void)
 remove objects with invalid targets from valid points
 
void trackTargets (void)
 keep attackers at the closest garrison point to their active target
 
void matchObjectsToGarrisonPoints (void)
 Every frame, and whenever anyone enters or leaves.
 
void positionObjectsAtStationGarrisonPoints (void)
 enforce that everybody stays at their pre-assigned space
 
void loadStationGarrisonPoints (void)
 
Bool pickAStationForMe (const Object *pbj)
 
void removeObjectFromStationPoint (const Object *obj)
 
Int findConditionIndex (void)
 find the condition index to use given the current object body state
 
Int getObjectGarrisonPointIndex (Object *obj)
 get the garrison point index object is at (if present)
 
Int findClosestFreeGarrisonPointIndex (Int conditionIndex, const Coord3D *targetPos)
 find closest free garrison point to the target location
 
void healObjects (void)
 heal all the objects within me
 
void healSingleObject (Object *obj, Real frames)
 heal just one of the objects within me
 
void moveObjectsWithMe (void)
 translates all the garrisoned object to this->getObject()->getPosition()
 
- 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
 
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
 

Additional Inherited Members

- 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 Attributes inherited from OpenContain
ContainedItemsList m_containList
 the list of contained objects
 
UnsignedInt m_containListSize
 size of contained list
 

Detailed Description

A GarrisonContain is used for objects that can be garrisoned, heh, go figure

Definition at line 100 of file GarrisonContain.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
SEARCH_FOR_REMOVE 

Definition at line 164 of file GarrisonContain.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
GARRISON_INDEX_INVALID 

Definition at line 176 of file GarrisonContain.h.

Constructor & Destructor Documentation

◆ GarrisonContain()

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

Definition at line 505 of file GarrisonContain.cpp.

Member Function Documentation

◆ addValidObjectsToGarrisonPoints()

void GarrisonContain::addValidObjectsToGarrisonPoints ( void )
protected

add any objects with targets to a garrison point

Are there any objects in the center that have now obtained targets and need to move to a garrison point

Definition at line 637 of file GarrisonContain.cpp.

◆ attemptBestFirePointPosition() [1/2]

Bool GarrisonContain::attemptBestFirePointPosition ( Object * source,
Weapon * weapon,
const Coord3D * targetPos )
protectedvirtual

if my object gets selected, then my visible passengers should, too this gets called from

Reimplemented from OpenContain.

Definition at line 353 of file GarrisonContain.cpp.

◆ attemptBestFirePointPosition() [2/2]

Bool GarrisonContain::attemptBestFirePointPosition ( Object * source,
Weapon * weapon,
Object * victim )
protectedvirtual

Reimplemented from OpenContain.

Definition at line 312 of file GarrisonContain.cpp.

◆ calcBestGarrisonPosition()

Bool GarrisonContain::calcBestGarrisonPosition ( Coord3D * sourcePos,
const Coord3D * targetPos )
protectedvirtual

Reimplemented from OpenContain.

Definition at line 280 of file GarrisonContain.cpp.

◆ exitObjectByBudding()

virtual void GarrisonContain::exitObjectByBudding ( Object * newObj,
Object * budHost )
inlinevirtual

puts new spawn on top of an existing one

Reimplemented from OpenContain.

Definition at line 126 of file GarrisonContain.h.

◆ exitObjectViaDoor()

void GarrisonContain::exitObjectViaDoor ( Object * exitObj,
ExitDoorType exitDoor )
virtual

exit one of our content items from us

'exitObj' is one of the things we contain, it needs to 'exit' us

<

Todo
This really should be automatically wrapped up in an activation sequence for objects in general

<

Todo
This really should be automatically wrapped up in an activation sequence for objects in general

Reimplemented from OpenContain.

Definition at line 1497 of file GarrisonContain.cpp.

◆ findClosestFreeGarrisonPointIndex()

Int GarrisonContain::findClosestFreeGarrisonPointIndex ( Int conditionIndex,
const Coord3D * targetPos )
protected

find closest free garrison point to the target location

Given the target position, find the garrison point that is closest to it

Definition at line 94 of file GarrisonContain.cpp.

◆ findConditionIndex()

Int GarrisonContain::findConditionIndex ( void )
protected

find the condition index to use given the current object body state

Given the current state of the structure, return the condition index we are to use from the garrison point position arrays

Definition at line 235 of file GarrisonContain.cpp.

◆ getApparentControllingPlayer()

const Player * GarrisonContain::getApparentControllingPlayer ( const Player * observingPlayer) const
virtual

return the player that appears to control this unit, given an observing player. if null, use getObject()->getControllingPlayer() instead.

return the player that appears to control this unit. if null, use getObject()->getControllingPlayer() instead.

Reimplemented from OpenContain.

Definition at line 1191 of file GarrisonContain.cpp.

◆ getObjectGarrisonPointIndex()

Int GarrisonContain::getObjectGarrisonPointIndex ( Object * obj)
protected

get the garrison point index object is at (if present)

Given the object, return the garrison point index the object is placed at ... if any

Definition at line 135 of file GarrisonContain.cpp.

◆ healObjects()

void GarrisonContain::healObjects ( void )
protected

heal all the objects within me

Definition at line 1125 of file GarrisonContain.cpp.

◆ healSingleObject()

void GarrisonContain::healSingleObject ( Object * obj,
Real frames )
protected

heal just one of the objects within me

Definition at line 1150 of file GarrisonContain.cpp.

◆ isBustable()

virtual Bool GarrisonContain::isBustable ( ) const
inlinevirtual

can this container get busted by a bunkerbuster

Reimplemented from OpenContain.

Definition at line 115 of file GarrisonContain.h.

◆ isDisplayedOnControlBar()

virtual Bool GarrisonContain::isDisplayedOnControlBar ( ) const
inlinevirtual

Does this container display its contents on the ControlBar?

Reimplemented from OpenContain.

Definition at line 143 of file GarrisonContain.h.

◆ isEnclosingContainerFor()

virtual Bool GarrisonContain::isEnclosingContainerFor ( const Object * obj) const
inlinevirtual

Does this type of Contain Visibly enclose its contents?

Reimplemented from OpenContain.

Definition at line 120 of file GarrisonContain.h.

◆ isGarrisonable()

virtual Bool GarrisonContain::isGarrisonable ( ) const
inlinevirtual

can this unit be Garrisoned? (ick)

Reimplemented from OpenContain.

Definition at line 114 of file GarrisonContain.h.

◆ isHealContain()

virtual Bool GarrisonContain::isHealContain ( ) const
inlinevirtual

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

Reimplemented from OpenContain.

Definition at line 117 of file GarrisonContain.h.

◆ isImmuneToClearBuildingAttacks()

virtual Bool GarrisonContain::isImmuneToClearBuildingAttacks ( ) const
inlinevirtual

Reimplemented from OpenContain.

Definition at line 116 of file GarrisonContain.h.

◆ isPassengerAllowedToFire()

Bool GarrisonContain::isPassengerAllowedToFire ( ObjectID id = INVALID_ID) const
virtual

Hey, can I shoot out of this container?

A GarrisonContain always lets people shoot out

Reimplemented from OpenContain.

Definition at line 1715 of file GarrisonContain.cpp.

◆ isSpecialOverlordStyleContainer()

virtual Bool GarrisonContain::isSpecialOverlordStyleContainer ( ) const
inlinevirtual

Reimplemented from OpenContain.

Definition at line 121 of file GarrisonContain.h.

◆ isTunnelContain()

virtual Bool GarrisonContain::isTunnelContain ( ) const
inlinevirtual

Reimplemented from OpenContain.

Definition at line 118 of file GarrisonContain.h.

◆ isValidContainerFor()

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

can this container contain this kind of object? and, if checkCapacity is TRUE, does this container have enough space left to hold the given unit?

Reimplemented from OpenContain.

Definition at line 553 of file GarrisonContain.cpp.

◆ loadGarrisonPoints()

void GarrisonContain::loadGarrisonPoints ( void )
protected

load garrison point position data and save for later

Load the garrison point position data and save for use later

Definition at line 1306 of file GarrisonContain.cpp.

◆ loadStationGarrisonPoints()

void GarrisonContain::loadStationGarrisonPoints ( void )
protected

Load the loadStationGarrisonPoints data and save for use later

Definition at line 1982 of file GarrisonContain.cpp.

◆ matchObjectsToGarrisonPoints()

void GarrisonContain::matchObjectsToGarrisonPoints ( void )
protected

Every frame, and whenever anyone enters or leaves.

Every frame, and whenever anyone enters or leaves

Definition at line 977 of file GarrisonContain.cpp.

◆ moveObjectsWithMe()

void GarrisonContain::moveObjectsWithMe ( void )
protected

translates all the garrisoned object to this->getObject()->getPosition()

A Mobile garrison keeps its occupants with it when it moves

Definition at line 1729 of file GarrisonContain.cpp.

◆ onBodyDamageStateChange()

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

Die Interface state change callback.

Reimplemented from OpenContain.

Definition at line 1748 of file GarrisonContain.cpp.

◆ onContaining()

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

object now contains 'obj'

Reimplemented from OpenContain.

Definition at line 1613 of file GarrisonContain.cpp.

◆ onDamage()

void GarrisonContain::onDamage ( DamageInfo * info)
virtual

When I become damaged

Reimplemented from OpenContain.

Definition at line 1100 of file GarrisonContain.cpp.

◆ onObjectCreated()

void GarrisonContain::onObjectCreated ( void )
protectedvirtual

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 1761 of file GarrisonContain.cpp.

◆ onRemoving()

void GarrisonContain::onRemoving ( Object * obj)
virtual

object no longer contains 'obj'

Todo
: we should probably not draw the unit to begin with and just have them pop out.

Reimplemented from OpenContain.

Definition at line 1653 of file GarrisonContain.cpp.

◆ onSelling()

void GarrisonContain::onSelling ( void )
virtual

Container is being sold. Open responds by kicking people out.

Reimplemented from OpenContain.

Definition at line 1454 of file GarrisonContain.cpp.

◆ pickAStationForMe()

Bool GarrisonContain::pickAStationForMe ( const Object * obj)
protected

When a new guy enters a non-enclosing garrison container

Definition at line 1051 of file GarrisonContain.cpp.

◆ positionObjectsAtStationGarrisonPoints()

void GarrisonContain::positionObjectsAtStationGarrisonPoints ( void )
protected

enforce that everybody stays at their pre-assigned space

enforce that everybody stays at their pre-assigned space

Definition at line 1007 of file GarrisonContain.cpp.

◆ putObjectAtBestGarrisonPoint()

void GarrisonContain::putObjectAtBestGarrisonPoint ( Object * obj,
Object * target,
const Coord3D * targetPos )
protected

place object at position of the best garrison point to use for its target

Place the object at the "best" garrison point position so it's on the same "side" of the structure that its target is

Definition at line 394 of file GarrisonContain.cpp.

◆ putObjectAtGarrisonPoint()

void GarrisonContain::putObjectAtGarrisonPoint ( Object * obj,
ObjectID targetID,
Int conditionIndex,
Int pointIndex )
protected

place object at the specified garrison point index

Put the object at the specified garrison point by index

Definition at line 153 of file GarrisonContain.cpp.

◆ recalcApparentControllingPlayer()

void GarrisonContain::recalcApparentControllingPlayer ( void )
virtual

Reimplemented from OpenContain.

Definition at line 1206 of file GarrisonContain.cpp.

◆ redeployOccupants()

void GarrisonContain::redeployOccupants ( void )
protectedvirtual

redeploy the occupants of us at all available garrison points

Remove all the objects at garrison points back to the center and redeploy them among the garrison points. NOTE that we are preserving the frame in which the object was put at the garrison point originally as this method is used when the model condition changes which could shuffle the garrison point positions but that shouldn't logically change when an object was placed at the point

Reimplemented from OpenContain.

Definition at line 785 of file GarrisonContain.cpp.

◆ removeAllContained()

void GarrisonContain::removeAllContained ( Bool exposeStealthUnits)
virtual

remove all contents of this open container

Remove all contents of this container. We will try to do so with intelligent garrison logic, but if all else fails no matter, we need to get all things out after this call is complete

Reimplemented from OpenContain.

Definition at line 1467 of file GarrisonContain.cpp.

◆ removeInvalidObjectsFromGarrisonPoints()

void GarrisonContain::removeInvalidObjectsFromGarrisonPoints ( void )
protected

remove objects with invalid targets from valid points

Any objects that are sitting at the garrison points which no longer have targets need to be moved to the center of the building and taken off the garrison point

Definition at line 588 of file GarrisonContain.cpp.

◆ removeObjectFromGarrisonPoint()

void GarrisonContain::removeObjectFromGarrisonPoint ( Object * obj,
Int index = SEARCH_FOR_REMOVE )
protected

remove object from the garrison point placement

Remove the object from the garrison point position and replace at the center of the building

Definition at line 430 of file GarrisonContain.cpp.

◆ removeObjectFromStationPoint()

void GarrisonContain::removeObjectFromStationPoint ( const Object * obj)
protected

Definition at line 1071 of file GarrisonContain.cpp.

◆ setEvacDisposition()

virtual void GarrisonContain::setEvacDisposition ( EvacDisposition disp)
inlinevirtual

Reimplemented from OpenContain.

Definition at line 147 of file GarrisonContain.h.

◆ trackTargets()

void GarrisonContain::trackTargets ( void )
protected

keep attackers at the closest garrison point to their active target

Every frame this method is called. It keeps any of the attacking units at any of the fire points closest to their active target and shuffles them around to any open garrison points that are available if they are closer. We will also track our targets position and orient any effect stuff we need to (gun barrel / muzzle flash)

Definition at line 682 of file GarrisonContain.cpp.

◆ update()

UpdateSleepTime GarrisonContain::update ( void )
virtual

called once per frame

Reimplemented from OpenContain.

Definition at line 909 of file GarrisonContain.cpp.

◆ updateEffects()

void GarrisonContain::updateEffects ( void )
protected

do any effects needed per frame

Do any effects during an update cycle that we need to

Definition at line 832 of file GarrisonContain.cpp.

◆ validateRallyPoint()

void GarrisonContain::validateRallyPoint ( void )
protected

validate (if necessary) and pick (if possible) an exit rally point

Validate any exit rally point that has been chosen (if any). If it's not valid, try to find a new one

Definition at line 1412 of file GarrisonContain.cpp.


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