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

#include <Weapon.h>

Inherits SubsystemInterface.

Public Member Functions

 WeaponStore ()
 
 ~WeaponStore ()
 
void init ()
 
void postProcessLoad ()
 
void reset ()
 
void update ()
 
const WeaponTemplatefindWeaponTemplate (AsciiString name) const
 
const WeaponTemplatefindWeaponTemplateByNameKey (NameKeyType key) const
 
WeaponallocateNewWeapon (const WeaponTemplate *tmpl, WeaponSlotType wslot) const
 
void createAndFireTempWeapon (const WeaponTemplate *w, const Object *source, const Coord3D *pos)
 
void createAndFireTempWeapon (const WeaponTemplate *w, const Object *source, Object *target)
 
void handleProjectileDetonation (const WeaponTemplate *w, const Object *source, const Coord3D *pos, WeaponBonusConditionFlags extraBonusFlags, Bool inflictDamage=TRUE)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Static Public Member Functions

static void parseWeaponTemplateDefinition (INI *ini)
 

Protected Member Functions

WeaponTemplatefindWeaponTemplatePrivate (NameKeyType key) const
 
WeaponTemplatenewWeaponTemplate (AsciiString name)
 
WeaponTemplatenewOverride (WeaponTemplate *weaponTemplate)
 
void deleteAllDelayedDamage ()
 
void resetWeaponTemplates (void)
 
void setDelayedDamage (const WeaponTemplate *weapon, const Coord3D *pos, UnsignedInt whichFrame, ObjectID sourceID, ObjectID victimID, const WeaponBonus &bonus)
 

Friends

class WeaponTemplate
 

Additional Inherited Members

- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

The "store" used to hold all the WeaponTemplates in existence. This is usually used when creating an Object, but can be used at any time after that. (It is explicitly OK to swap an Object's Weapon out at any given time.)

Definition at line 818 of file Weapon.h.

Constructor & Destructor Documentation

◆ WeaponStore()

WeaponStore::WeaponStore ( )

Definition at line 1509 of file Weapon.cpp.

◆ ~WeaponStore()

WeaponStore::~WeaponStore ( )

Definition at line 1514 of file Weapon.cpp.

Member Function Documentation

◆ allocateNewWeapon()

Weapon * WeaponStore::allocateNewWeapon ( const WeaponTemplate * tmpl,
WeaponSlotType wslot ) const
inline

Definition at line 839 of file Weapon.h.

◆ createAndFireTempWeapon() [1/2]

void WeaponStore::createAndFireTempWeapon ( const WeaponTemplate * w,
const Object * source,
const Coord3D * pos )

Definition at line 1537 of file Weapon.cpp.

◆ createAndFireTempWeapon() [2/2]

void WeaponStore::createAndFireTempWeapon ( const WeaponTemplate * w,
const Object * source,
Object * target )

Definition at line 1548 of file Weapon.cpp.

◆ deleteAllDelayedDamage()

void WeaponStore::deleteAllDelayedDamage ( )
protected

Definition at line 1633 of file Weapon.cpp.

◆ findWeaponTemplate()

const WeaponTemplate * WeaponStore::findWeaponTemplate ( AsciiString name) const

Find the WeaponTemplate with the given name. If no such WeaponTemplate exists, return null.

Definition at line 1560 of file Weapon.cpp.

◆ findWeaponTemplateByNameKey()

const WeaponTemplate * WeaponStore::findWeaponTemplateByNameKey ( NameKeyType key) const
inline

Definition at line 836 of file Weapon.h.

◆ findWeaponTemplatePrivate()

WeaponTemplate * WeaponStore::findWeaponTemplatePrivate ( NameKeyType key) const
protected

Definition at line 1570 of file Weapon.cpp.

◆ handleProjectileDetonation()

void WeaponStore::handleProjectileDetonation ( const WeaponTemplate * w,
const Object * source,
const Coord3D * pos,
WeaponBonusConditionFlags extraBonusFlags,
Bool inflictDamage = TRUE )

Definition at line 1528 of file Weapon.cpp.

◆ init()

void WeaponStore::init ( )
inlinevirtual
  • Assign any default values to data required for the class
    • Allocate any memory and resources needed throughout the lifetime of the class

Implements SubsystemInterface.

Definition at line 827 of file Weapon.h.

◆ newOverride()

WeaponTemplate * WeaponStore::newOverride ( WeaponTemplate * weaponTemplate)
protected

Definition at line 1599 of file Weapon.cpp.

◆ newWeaponTemplate()

WeaponTemplate * WeaponStore::newWeaponTemplate ( AsciiString name)
protected

Definition at line 1582 of file Weapon.cpp.

◆ parseWeaponTemplateDefinition()

void WeaponStore::parseWeaponTemplateDefinition ( INI * ini)
static

Definition at line 1701 of file Weapon.cpp.

◆ postProcessLoad()

void WeaponStore::postProcessLoad ( void )
virtual
  • Called for all subsystems after all other Subsystems are inited. (allows for initializing inter-system dependencies)

Reimplemented from SubsystemInterface.

Definition at line 1683 of file Weapon.cpp.

◆ reset()

void WeaponStore::reset ( )
virtual
  • Any system should be able to reset all data and go back to an empty state that is ready to accept a completely new set of data. Reset() can expect to be used in the context of resetting the engine in order to start or load a new game.
    • Do NOT free and re-allocate resources needed, where possible reorganize and re-initialize the resources already allocated.
    • After a reset, the system does not need to be in EXACTLY the same state as a fresh instantiation. If there are persistent state information for the system make sure you maintain it while restoring or re-initializing other transient parts.

Implements SubsystemInterface.

Definition at line 1651 of file Weapon.cpp.

◆ resetWeaponTemplates()

void WeaponStore::resetWeaponTemplates ( void )
protected

Definition at line 1639 of file Weapon.cpp.

◆ setDelayedDamage()

void WeaponStore::setDelayedDamage ( const WeaponTemplate * weapon,
const Coord3D * pos,
UnsignedInt whichFrame,
ObjectID sourceID,
ObjectID victimID,
const WeaponBonus & bonus )
protected

Definition at line 1670 of file Weapon.cpp.

◆ update()

void WeaponStore::update ( )
virtual
  • Update methods are the place to do system per frame processing. You should call the system update once each time through the game loop to service the system.
    • Note that currently the GameClient and GameLogic will be updating at different rates where the logic is running real time, and the client will adjust how many loops can be done during one server time slice in order to improve performance on low end machines.

Implements SubsystemInterface.

Definition at line 1613 of file Weapon.cpp.

Friends And Related Symbol Documentation

◆ WeaponTemplate

friend class WeaponTemplate
friend

Definition at line 820 of file Weapon.h.


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