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

#include <Upgrade.h>

Inherits SubsystemInterface.

Public Member Functions

 UpgradeCenter (void)
 
virtual ~UpgradeCenter (void)
 
void init (void)
 subsystem interface
 
void reset (void)
 subsystem interface
 
void update (void)
 subsystem interface
 
UpgradeTemplatefirstUpgradeTemplate (void)
 return the first upgrade template
 
const UpgradeTemplatefindUpgradeByKey (NameKeyType key) const
 find upgrade by name key
 
const UpgradeTemplatefindUpgrade (const AsciiString &name) const
 find and return upgrade by name
 
const UpgradeTemplatefindVeterancyUpgrade (VeterancyLevel level) const
 find and return upgrade by name
 
UpgradeTemplatenewUpgrade (const AsciiString &name)
 allocate, link, and return new upgrade
 
Bool canAffordUpgrade (Player *player, const UpgradeTemplate *upgradeTemplate, Bool displayReason=FALSE) const
 does this player have all the necessary things to make this upgrade
 
std::vector< AsciiStringgetUpgradeNames (void) const
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Static Public Member Functions

static void parseUpgradeDefinition (INI *ini)
 

Protected Member Functions

UpgradeTemplatefindNonConstUpgradeByKey (NameKeyType key)
 find upgrade by name key
 
void linkUpgrade (UpgradeTemplate *upgrade)
 link upgrade to list
 
void unlinkUpgrade (UpgradeTemplate *upgrade)
 remove upgrade from list
 

Protected Attributes

UpgradeTemplatem_upgradeList
 list of all upgrades we can have
 
Int m_nextTemplateMaskBit
 Each instantiated UpgradeTemplate will be given a Int64 bit as an identifier.
 
Bool buttonImagesCached
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

The upgrade center keeps some basic information about the possible upgrades

Definition at line 228 of file Upgrade.h.

Constructor & Destructor Documentation

◆ UpgradeCenter()

UpgradeCenter::UpgradeCenter ( void )

Definition at line 225 of file Upgrade.cpp.

◆ ~UpgradeCenter()

UpgradeCenter::~UpgradeCenter ( void )
virtual

Definition at line 236 of file Upgrade.cpp.

Member Function Documentation

◆ canAffordUpgrade()

Bool UpgradeCenter::canAffordUpgrade ( Player * player,
const UpgradeTemplate * upgradeTemplate,
Bool displayReason = FALSE ) const

does this player have all the necessary things to make this upgrade

does this player have all the necessary things to make this upgrade

Todo
maybe have prereq checks for upgrades???

Definition at line 433 of file Upgrade.cpp.

◆ findNonConstUpgradeByKey()

UpgradeTemplate * UpgradeCenter::findNonConstUpgradeByKey ( NameKeyType key)
protected

find upgrade by name key

Find upgrade matching name key

Definition at line 309 of file Upgrade.cpp.

◆ findUpgrade()

const UpgradeTemplate * UpgradeCenter::findUpgrade ( const AsciiString & name) const

find and return upgrade by name

Find upgrade matching name

Definition at line 352 of file Upgrade.cpp.

◆ findUpgradeByKey()

const UpgradeTemplate * UpgradeCenter::findUpgradeByKey ( NameKeyType key) const

find upgrade by name key

Find upgrade matching name key

Definition at line 336 of file Upgrade.cpp.

◆ findVeterancyUpgrade()

const UpgradeTemplate * UpgradeCenter::findVeterancyUpgrade ( VeterancyLevel level) const

find and return upgrade by name

Find upgrade matching name key

Definition at line 300 of file Upgrade.cpp.

◆ firstUpgradeTemplate()

UpgradeTemplate * UpgradeCenter::firstUpgradeTemplate ( void )

return the first upgrade template

Return the first upgrade template

Definition at line 326 of file Upgrade.cpp.

◆ getUpgradeNames()

std::vector< AsciiString > UpgradeCenter::getUpgradeNames ( void ) const

generate a list of upgrade names for WorldBuilder

Definition at line 461 of file Upgrade.cpp.

◆ init()

void UpgradeCenter::init ( void )
virtual

subsystem interface

Upgrade center initialization

Implements SubsystemInterface.

Definition at line 260 of file Upgrade.cpp.

◆ linkUpgrade()

void UpgradeCenter::linkUpgrade ( UpgradeTemplate * upgrade)
protected

link upgrade to list

Link an upgrade to our list

Definition at line 395 of file Upgrade.cpp.

◆ newUpgrade()

UpgradeTemplate * UpgradeCenter::newUpgrade ( const AsciiString & name)

allocate, link, and return new upgrade

Allocate a new upgrade template

Definition at line 362 of file Upgrade.cpp.

◆ parseUpgradeDefinition()

void UpgradeCenter::parseUpgradeDefinition ( INI * ini)
static

Parse an upgrade definition

Definition at line 475 of file Upgrade.cpp.

◆ reset()

void UpgradeCenter::reset ( void )
virtual

subsystem interface

Upgrade center system reset

Implements SubsystemInterface.

Definition at line 284 of file Upgrade.cpp.

◆ unlinkUpgrade()

void UpgradeCenter::unlinkUpgrade ( UpgradeTemplate * upgrade)
protected

remove upgrade from list

Unlink an upgrade from our list

Definition at line 414 of file Upgrade.cpp.

◆ update()

void UpgradeCenter::update ( void )
inlinevirtual

subsystem interface

Implements SubsystemInterface.

Definition at line 238 of file Upgrade.h.

Member Data Documentation

◆ buttonImagesCached

Bool UpgradeCenter::buttonImagesCached
protected

Definition at line 262 of file Upgrade.h.

◆ m_nextTemplateMaskBit

Int UpgradeCenter::m_nextTemplateMaskBit
protected

Each instantiated UpgradeTemplate will be given a Int64 bit as an identifier.

Definition at line 261 of file Upgrade.h.

◆ m_upgradeList

UpgradeTemplate* UpgradeCenter::m_upgradeList
protected

list of all upgrades we can have

Definition at line 260 of file Upgrade.h.


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