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

#include <ProductionUpdate.h>

Inherits UpdateModule, ProductionUpdateInterface, and DieModuleInterface.

Classes

struct  DoorInfo
 

Public Member Functions

 ProductionUpdate (Thing *thing, const ModuleData *moduleData)
 
virtual DisabledMaskType getDisabledTypesToProcess () const
 
virtual ProductionUpdateInterfacegetProductionUpdateInterface (void)
 
virtual DieModuleInterfacegetDie ()
 
virtual CanMakeType canQueueCreateUnit (const ThingTemplate *unitType) const
 
virtual CanMakeType canQueueUpgrade (const UpgradeTemplate *upgrade) const
 
virtual ProductionID requestUniqueUnitID (void)
 
virtual Bool queueUpgrade (const UpgradeTemplate *upgrade)
 queue upgrade "research"
 
virtual void cancelUpgrade (const UpgradeTemplate *upgrade)
 cancel upgrade "research"
 
virtual Bool isUpgradeInQueue (const UpgradeTemplate *upgrade) const
 is the upgrade in our production queue already
 
virtual UnsignedInt countUnitTypeInQueue (const ThingTemplate *unitType) const
 count number of units with matching unit type in the production queue
 
virtual Bool queueCreateUnit (const ThingTemplate *unitType, ProductionID productionID)
 queue unit to be produced
 
virtual void cancelUnitCreate (ProductionID productionID)
 cancel construction of unit with matching production ID
 
virtual void cancelAllUnitsOfType (const ThingTemplate *unitType)
 cancel all production of type unitType
 
virtual void cancelAndRefundAllProduction (void)
 cancel and refund anything in the production queue
 
virtual UnsignedInt getProductionCount (void) const
 return # of things in the production queue
 
virtual const ProductionEntryfirstProduction (void) const
 
virtual const ProductionEntrynextProduction (const ProductionEntry *p) const
 
virtual void setHoldDoorOpen (ExitDoorType exitDoor, Bool holdIt)
 
virtual UpdateSleepTime update (void)
 the update
 
virtual const CommandButtongetSpecialPowerConstructionCommandButton () const
 
virtual void setSpecialPowerConstructionCommandButton (const CommandButton *commandButton)
 
virtual void onDie (const DamageInfo *damageInfo)
 
- 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 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 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)
 

Static Public Member Functions

static Int getInterfaceMask ()
 
static ProductionUpdateInterfacegetProductionUpdateInterfaceFromObject (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 addToProductionQueue (ProductionEntry *production)
 add to END of production queue list
 
void removeFromProductionQueue (ProductionEntry *production)
 remove production from the queue list
 
void updateDoors ()
 update the door behavior
 
- 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

const CommandButtonm_specialPowerConstructionCommandButton
 In a mode to construct a specific building via a special power. (NO NEED TO SAVE DATA ON THIS FIELD)
 
ProductionEntrym_productionQueue
 queue of things we want to build
 
ProductionEntrym_productionQueueTail
 tail pointer for m_productionQueue
 
ProductionID m_uniqueID
 unique ID counter for producing units
 
UnsignedInt m_productionCount
 
UnsignedInt m_constructionCompleteFrame
 frame construction was complete on
 
DoorInfo m_doors [DOOR_COUNT_MAX]
 
ModelConditionFlags m_clearFlags
 flags to clear from model
 
ModelConditionFlags m_setFlags
 flags to set in model
 
Bool m_flagsDirty
 clearFlags/setFlags needs to be set into the model
 

Detailed Description

Production modules do actual unit construction

Definition at line 186 of file ProductionUpdate.h.

Constructor & Destructor Documentation

◆ ProductionUpdate()

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

Definition at line 186 of file ProductionUpdate.cpp.

Member Function Documentation

◆ addToProductionQueue()

void ProductionUpdate::addToProductionQueue ( ProductionEntry * production)
protected

add to END of production queue list

Add the production entry to the END of the production queue list

Definition at line 992 of file ProductionUpdate.cpp.

◆ cancelAllUnitsOfType()

void ProductionUpdate::cancelAllUnitsOfType ( const ThingTemplate * unitType)
virtual

cancel all production of type unitType

Cancel all production of type unitType

Implements ProductionUpdateInterface.

Definition at line 501 of file ProductionUpdate.cpp.

◆ cancelAndRefundAllProduction()

void ProductionUpdate::cancelAndRefundAllProduction ( void )
virtual

cancel and refund anything in the production queue

Cancel each of the production items in the queue. By going through the actual cancel methods, the cost of each of those items will be refunded to the player

Implements ProductionUpdateInterface.

Definition at line 1143 of file ProductionUpdate.cpp.

◆ cancelUnitCreate()

void ProductionUpdate::cancelUnitCreate ( ProductionID productionID)
virtual

cancel construction of unit with matching production ID

Cancel the construction of the unit with the matching production ID

Implements ProductionUpdateInterface.

Definition at line 467 of file ProductionUpdate.cpp.

◆ cancelUpgrade()

void ProductionUpdate::cancelUpgrade ( const UpgradeTemplate * upgrade)
virtual

cancel upgrade "research"

Cancel an upgrade being produced here

Implements ProductionUpdateInterface.

Definition at line 332 of file ProductionUpdate.cpp.

◆ canQueueCreateUnit()

CanMakeType ProductionUpdate::canQueueCreateUnit ( const ThingTemplate * unitType) const
virtual
Todo
srj – this is horrible, but the "right" way to do it is to move

Implements ProductionUpdateInterface.

Definition at line 238 of file ProductionUpdate.cpp.

◆ canQueueUpgrade()

CanMakeType ProductionUpdate::canQueueUpgrade ( const UpgradeTemplate * upgrade) const
virtual

Implements ProductionUpdateInterface.

Definition at line 228 of file ProductionUpdate.cpp.

◆ countUnitTypeInQueue()

UnsignedInt ProductionUpdate::countUnitTypeInQueue ( const ThingTemplate * unitType) const
virtual

count number of units with matching unit type in the production queue

count number of units with matching unit type in the production queue

Implements ProductionUpdateInterface.

Definition at line 1117 of file ProductionUpdate.cpp.

◆ firstProduction()

virtual const ProductionEntry * ProductionUpdate::firstProduction ( void ) const
inlinevirtual

Implements ProductionUpdateInterface.

Definition at line 228 of file ProductionUpdate.h.

◆ getDie()

virtual DieModuleInterface * ProductionUpdate::getDie ( void )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 203 of file ProductionUpdate.h.

◆ getDisabledTypesToProcess()

virtual DisabledMaskType ProductionUpdate::getDisabledTypesToProcess ( ) const
inlinevirtual

Implements UpdateModuleInterface.

Definition at line 200 of file ProductionUpdate.h.

◆ getInterfaceMask()

static Int ProductionUpdate::getInterfaceMask ( void )
inlinestatic

Definition at line 197 of file ProductionUpdate.h.

◆ getProductionCount()

virtual UnsignedInt ProductionUpdate::getProductionCount ( void ) const
inlinevirtual

return # of things in the production queue

Implements ProductionUpdateInterface.

Definition at line 225 of file ProductionUpdate.h.

◆ getProductionUpdateInterface()

virtual ProductionUpdateInterface * ProductionUpdate::getProductionUpdateInterface ( void )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 202 of file ProductionUpdate.h.

◆ getProductionUpdateInterfaceFromObject()

ProductionUpdateInterface * ProductionUpdate::getProductionUpdateInterfaceFromObject ( Object * obj)
static

Helper method to retrieve a production update interface from an object if one is present

Definition at line 1187 of file ProductionUpdate.cpp.

◆ getSpecialPowerConstructionCommandButton()

virtual const CommandButton * ProductionUpdate::getSpecialPowerConstructionCommandButton ( ) const
inlinevirtual

Implements ProductionUpdateInterface.

Definition at line 237 of file ProductionUpdate.h.

◆ isUpgradeInQueue()

Bool ProductionUpdate::isUpgradeInQueue ( const UpgradeTemplate * upgrade) const
virtual

is the upgrade in our production queue already

Is the upgrade already in the production queue. Note that you can only have one production entry for any given upgrade in the queue

Implements ProductionUpdateInterface.

Definition at line 1101 of file ProductionUpdate.cpp.

◆ nextProduction()

virtual const ProductionEntry * ProductionUpdate::nextProduction ( const ProductionEntry * p) const
inlinevirtual

Implements ProductionUpdateInterface.

Definition at line 229 of file ProductionUpdate.h.

◆ onDie()

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

Implements DieModuleInterface.

Definition at line 1133 of file ProductionUpdate.cpp.

◆ queueCreateUnit()

Bool ProductionUpdate::queueCreateUnit ( const ThingTemplate * unitType,
ProductionID productionID )
virtual

queue unit to be produced

Queue the prodcution of a unit. Returns TRUE if unit was added to queue, FALSE if it was not

Todo
srj – this is horrible, but the "right" way to do it is to move

Implements ProductionUpdateInterface.

Definition at line 387 of file ProductionUpdate.cpp.

◆ queueUpgrade()

Bool ProductionUpdate::queueUpgrade ( const UpgradeTemplate * upgrade)
virtual

queue upgrade "research"

Queue an upgrade to be produced

Implements ProductionUpdateInterface.

Definition at line 263 of file ProductionUpdate.cpp.

◆ removeFromProductionQueue()

void ProductionUpdate::removeFromProductionQueue ( ProductionEntry * production)
protected

remove production from the queue list

Remove the production entry from the production queue list

Definition at line 1035 of file ProductionUpdate.cpp.

◆ requestUniqueUnitID()

virtual ProductionID ProductionUpdate::requestUniqueUnitID ( void )
inlinevirtual

this method is used to request a unique ID to assign to the production of a single unit. It is unique to all units that can be created from this source object, but is not unique amoung multiple source objects

Implements ProductionUpdateInterface.

Definition at line 212 of file ProductionUpdate.h.

◆ setHoldDoorOpen()

void ProductionUpdate::setHoldDoorOpen ( ExitDoorType exitDoor,
Bool holdIt )
virtual

Implements ProductionUpdateInterface.

Definition at line 1169 of file ProductionUpdate.cpp.

◆ setSpecialPowerConstructionCommandButton()

virtual void ProductionUpdate::setSpecialPowerConstructionCommandButton ( const CommandButton * commandButton)
inlinevirtual

Implements ProductionUpdateInterface.

Definition at line 238 of file ProductionUpdate.h.

◆ update()

UpdateSleepTime ProductionUpdate::update ( void )
virtual

the update

Todo
srj use SLEEPY_UPDATE here

Implements UpdateModule.

Definition at line 611 of file ProductionUpdate.cpp.

◆ updateDoors()

void ProductionUpdate::updateDoors ( )
protected

update the door behavior

Update the door behavior

Definition at line 537 of file ProductionUpdate.cpp.

Member Data Documentation

◆ m_clearFlags

ModelConditionFlags ProductionUpdate::m_clearFlags
protected

flags to clear from model

Definition at line 266 of file ProductionUpdate.h.

◆ m_constructionCompleteFrame

UnsignedInt ProductionUpdate::m_constructionCompleteFrame
protected

frame construction was complete on

Definition at line 264 of file ProductionUpdate.h.

◆ m_doors

DoorInfo ProductionUpdate::m_doors[DOOR_COUNT_MAX]
protected

Definition at line 265 of file ProductionUpdate.h.

◆ m_flagsDirty

Bool ProductionUpdate::m_flagsDirty
protected

clearFlags/setFlags needs to be set into the model

Definition at line 268 of file ProductionUpdate.h.

◆ m_productionCount

UnsignedInt ProductionUpdate::m_productionCount
protected

of things in the production queue

Definition at line 263 of file ProductionUpdate.h.

◆ m_productionQueue

ProductionEntry* ProductionUpdate::m_productionQueue
protected

queue of things we want to build

Definition at line 260 of file ProductionUpdate.h.

◆ m_productionQueueTail

ProductionEntry* ProductionUpdate::m_productionQueueTail
protected

tail pointer for m_productionQueue

Definition at line 261 of file ProductionUpdate.h.

◆ m_setFlags

ModelConditionFlags ProductionUpdate::m_setFlags
protected

flags to set in model

Definition at line 267 of file ProductionUpdate.h.

◆ m_specialPowerConstructionCommandButton

const CommandButton* ProductionUpdate::m_specialPowerConstructionCommandButton
protected

In a mode to construct a specific building via a special power. (NO NEED TO SAVE DATA ON THIS FIELD)

Definition at line 259 of file ProductionUpdate.h.

◆ m_uniqueID

ProductionID ProductionUpdate::m_uniqueID
protected

unique ID counter for producing units

Definition at line 262 of file ProductionUpdate.h.


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