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

#include <Upgrade.h>

Inherits MemoryPoolObject.

Public Member Functions

 UpgradeTemplate (void)
 
Int calcTimeToBuild (Player *player) const
 time in logic frames it will take this player to "build" this UpgradeTemplate
 
Int calcCostToBuild (Player *player) const
 calc the cost to build this upgrade
 
void setUpgradeName (const AsciiString &name)
 
const AsciiStringgetUpgradeName (void) const
 
void setUpgradeNameKey (NameKeyType key)
 
NameKeyType getUpgradeNameKey (void) const
 
const AsciiStringgetDisplayNameLabel (void) const
 
UpgradeMaskType getUpgradeMask () const
 
UpgradeType getUpgradeType (void) const
 
const AudioEventRTSgetResearchCompleteSound () const
 
const AudioEventRTSgetUnitSpecificSound () const
 
AcademyClassificationType getAcademyClassificationType () const
 
void cacheButtonImage ()
 inventory pictures
 
const ImagegetButtonImage () const
 
const FieldParsegetFieldParse () const
 INI parsing.
 
void friend_setNext (UpgradeTemplate *next)
 
void friend_setPrev (UpgradeTemplate *prev)
 
UpgradeTemplatefriend_getNext (void)
 
UpgradeTemplatefriend_getPrev (void)
 
const UpgradeTemplatefriend_getNext (void) const
 
const UpgradeTemplatefriend_getPrev (void) const
 
void friend_setUpgradeMask (UpgradeMaskType mask)
 
void friend_makeVeterancyUpgrade (VeterancyLevel v)
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 

Protected Attributes

UpgradeType m_type
 upgrade type (PLAYER or OBJECT)
 
AsciiString m_name
 upgrade name
 
NameKeyType m_nameKey
 name key
 
AsciiString m_displayNameLabel
 String manager label for UI display name.
 
Real m_buildTime
 database # for how long it takes to "build" this
 
Int m_cost
 cost for production
 
UpgradeMaskType m_upgradeMask
 Unique bitmask for this upgrade template.
 
AudioEventRTS m_researchSound
 Sound played when upgrade researched.
 
AudioEventRTS m_unitSpecificSound
 Secondary sound played when upgrade researched.
 
AcademyClassificationType m_academyClassificationType
 A value used by the academy to evaluate advice based on what players do.
 
UpgradeTemplatem_next
 next
 
UpgradeTemplatem_prev
 prev
 
AsciiString m_buttonImageName
 "Queue" images to show in the build queue
 
const Imagem_buttonImage
 

Static Protected Attributes

static const FieldParse m_upgradeFieldParseTable []
 INI field table.
 

Additional Inherited Members

- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Detailed Description

A single upgrade template definition

Definition at line 159 of file Upgrade.h.

Constructor & Destructor Documentation

◆ UpgradeTemplate()

UpgradeTemplate::UpgradeTemplate ( void )

Definition at line 131 of file Upgrade.cpp.

Member Function Documentation

◆ cacheButtonImage()

void UpgradeTemplate::cacheButtonImage ( )

inventory pictures

Definition at line 208 of file Upgrade.cpp.

◆ calcCostToBuild()

Int UpgradeTemplate::calcCostToBuild ( Player * player) const

calc the cost to build this upgrade

Calculate the cost takes this player to build this upgrade

Todo
modify this by any player handicaps

Definition at line 174 of file Upgrade.cpp.

◆ calcTimeToBuild()

Int UpgradeTemplate::calcTimeToBuild ( Player * player) const

time in logic frames it will take this player to "build" this UpgradeTemplate

Calculate the time it takes (in logic frames) for a player to build this UpgradeTemplate

Todo
modify this by power state of player

Definition at line 157 of file Upgrade.cpp.

◆ friend_getNext() [1/2]

UpgradeTemplate * UpgradeTemplate::friend_getNext ( void )
inline

Definition at line 194 of file Upgrade.h.

◆ friend_getNext() [2/2]

const UpgradeTemplate * UpgradeTemplate::friend_getNext ( void ) const
inline

Definition at line 196 of file Upgrade.h.

◆ friend_getPrev() [1/2]

UpgradeTemplate * UpgradeTemplate::friend_getPrev ( void )
inline

Definition at line 195 of file Upgrade.h.

◆ friend_getPrev() [2/2]

const UpgradeTemplate * UpgradeTemplate::friend_getPrev ( void ) const
inline

Definition at line 197 of file Upgrade.h.

◆ friend_makeVeterancyUpgrade()

void UpgradeTemplate::friend_makeVeterancyUpgrade ( VeterancyLevel v)

Definition at line 194 of file Upgrade.cpp.

◆ friend_setNext()

void UpgradeTemplate::friend_setNext ( UpgradeTemplate * next)
inline

Definition at line 192 of file Upgrade.h.

◆ friend_setPrev()

void UpgradeTemplate::friend_setPrev ( UpgradeTemplate * prev)
inline

Definition at line 193 of file Upgrade.h.

◆ friend_setUpgradeMask()

void UpgradeTemplate::friend_setUpgradeMask ( UpgradeMaskType mask)
inline

Definition at line 198 of file Upgrade.h.

◆ getAcademyClassificationType()

AcademyClassificationType UpgradeTemplate::getAcademyClassificationType ( ) const
inline

Definition at line 182 of file Upgrade.h.

◆ getButtonImage()

const Image * UpgradeTemplate::getButtonImage ( ) const
inline

Definition at line 186 of file Upgrade.h.

◆ getDisplayNameLabel()

const AsciiString & UpgradeTemplate::getDisplayNameLabel ( void ) const
inline

Definition at line 177 of file Upgrade.h.

◆ getFieldParse()

const FieldParse * UpgradeTemplate::getFieldParse ( ) const
inline

INI parsing.

Definition at line 189 of file Upgrade.h.

◆ getResearchCompleteSound()

const AudioEventRTS * UpgradeTemplate::getResearchCompleteSound ( ) const
inline

Definition at line 180 of file Upgrade.h.

◆ getUnitSpecificSound()

const AudioEventRTS * UpgradeTemplate::getUnitSpecificSound ( ) const
inline

Definition at line 181 of file Upgrade.h.

◆ getUpgradeMask()

UpgradeMaskType UpgradeTemplate::getUpgradeMask ( ) const
inline

Definition at line 178 of file Upgrade.h.

◆ getUpgradeName()

const AsciiString & UpgradeTemplate::getUpgradeName ( void ) const
inline

Definition at line 174 of file Upgrade.h.

◆ getUpgradeNameKey()

NameKeyType UpgradeTemplate::getUpgradeNameKey ( void ) const
inline

Definition at line 176 of file Upgrade.h.

◆ getUpgradeType()

UpgradeType UpgradeTemplate::getUpgradeType ( void ) const
inline

Definition at line 179 of file Upgrade.h.

◆ setUpgradeName()

void UpgradeTemplate::setUpgradeName ( const AsciiString & name)
inline

Definition at line 173 of file Upgrade.h.

◆ setUpgradeNameKey()

void UpgradeTemplate::setUpgradeNameKey ( NameKeyType key)
inline

Definition at line 175 of file Upgrade.h.

Member Data Documentation

◆ m_academyClassificationType

AcademyClassificationType UpgradeTemplate::m_academyClassificationType
protected

A value used by the academy to evaluate advice based on what players do.

Definition at line 212 of file Upgrade.h.

◆ m_buildTime

Real UpgradeTemplate::m_buildTime
protected

database # for how long it takes to "build" this

Definition at line 207 of file Upgrade.h.

◆ m_buttonImage

const Image* UpgradeTemplate::m_buttonImage
protected

Definition at line 218 of file Upgrade.h.

◆ m_buttonImageName

AsciiString UpgradeTemplate::m_buttonImageName
protected

"Queue" images to show in the build queue

Definition at line 217 of file Upgrade.h.

◆ m_cost

Int UpgradeTemplate::m_cost
protected

cost for production

Definition at line 208 of file Upgrade.h.

◆ m_displayNameLabel

AsciiString UpgradeTemplate::m_displayNameLabel
protected

String manager label for UI display name.

Definition at line 206 of file Upgrade.h.

◆ m_name

AsciiString UpgradeTemplate::m_name
protected

upgrade name

Definition at line 204 of file Upgrade.h.

◆ m_nameKey

NameKeyType UpgradeTemplate::m_nameKey
protected

name key

Definition at line 205 of file Upgrade.h.

◆ m_next

UpgradeTemplate* UpgradeTemplate::m_next
protected

next

Definition at line 214 of file Upgrade.h.

◆ m_prev

UpgradeTemplate* UpgradeTemplate::m_prev
protected

prev

Definition at line 215 of file Upgrade.h.

◆ m_researchSound

AudioEventRTS UpgradeTemplate::m_researchSound
protected

Sound played when upgrade researched.

Definition at line 210 of file Upgrade.h.

◆ m_type

UpgradeType UpgradeTemplate::m_type
protected

upgrade type (PLAYER or OBJECT)

Definition at line 203 of file Upgrade.h.

◆ m_unitSpecificSound

AudioEventRTS UpgradeTemplate::m_unitSpecificSound
protected

Secondary sound played when upgrade researched.

Definition at line 211 of file Upgrade.h.

◆ m_upgradeFieldParseTable

const FieldParse UpgradeTemplate::m_upgradeFieldParseTable
staticprotected
Initial value:
=
{
{ "DisplayName", INI::parseAsciiString, NULL, offsetof( UpgradeTemplate, m_displayNameLabel ) },
{ "BuildTime", INI::parseReal, NULL, offsetof( UpgradeTemplate, m_buildTime ) },
{ "BuildCost", INI::parseInt, NULL, offsetof( UpgradeTemplate, m_cost ) },
{ "ButtonImage", INI::parseAsciiString, NULL, offsetof( UpgradeTemplate, m_buttonImageName ) },
{ "ResearchSound", INI::parseAudioEventRTS, NULL, offsetof( UpgradeTemplate, m_researchSound ) },
{ "UnitSpecificSound", INI::parseAudioEventRTS, NULL, offsetof( UpgradeTemplate, m_unitSpecificSound ) },
{ NULL, NULL, NULL, 0 }
}
const char * TheAcademyClassificationTypeNames[]
#define NULL
Definition BaseType.h:92
const char * TheUpgradeTypeNames[]
Definition Upgrade.cpp:41
static void parseIndexList(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:1399
static void parseAudioEventRTS(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:1170
static void parseInt(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:538
static void parseAsciiString(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:653
static void parseReal(INI *ini, void *instance, void *store, const void *userData)
Definition INI.cpp:558
AudioEventRTS m_unitSpecificSound
Secondary sound played when upgrade researched.
Definition Upgrade.h:211
AsciiString m_displayNameLabel
String manager label for UI display name.
Definition Upgrade.h:206
UpgradeTemplate(void)
Definition Upgrade.cpp:131
Real m_buildTime
database # for how long it takes to "build" this
Definition Upgrade.h:207
Int m_cost
cost for production
Definition Upgrade.h:208
UpgradeType m_type
upgrade type (PLAYER or OBJECT)
Definition Upgrade.h:203
AsciiString m_buttonImageName
"Queue" images to show in the build queue
Definition Upgrade.h:217
AcademyClassificationType m_academyClassificationType
A value used by the academy to evaluate advice based on what players do.
Definition Upgrade.h:212
AudioEventRTS m_researchSound
Sound played when upgrade researched.
Definition Upgrade.h:210

INI field table.

the parse table

Definition at line 114 of file Upgrade.h.

◆ m_upgradeMask

UpgradeMaskType UpgradeTemplate::m_upgradeMask
protected

Unique bitmask for this upgrade template.

Definition at line 209 of file Upgrade.h.


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