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

#include <Science.h>

Inherits SubsystemInterface.

Public Member Functions

virtual ~ScienceStore ()
 
void init ()
 
void reset ()
 
void update ()
 
Bool isValidScience (ScienceType st) const
 
Bool isScienceGrantable (ScienceType st) const
 
Bool getNameAndDescription (ScienceType st, UnicodeString &name, UnicodeString &description) const
 
Bool playerHasPrereqsForScience (const Player *player, ScienceType st) const
 
Bool playerHasRootPrereqsForScience (const Player *player, ScienceType st) const
 
Int getSciencePurchaseCost (ScienceType science) const
 
ScienceType getScienceFromInternalName (const AsciiString &name) const
 
AsciiString getInternalNameForScience (ScienceType science) const
 
void getPurchasableSciences (const Player *player, ScienceVec &purchasable, ScienceVec &potentiallyPurchasable) const
 
ScienceType friend_lookupScience (const char *scienceName) const
 
std::vector< AsciiStringfriend_getScienceNames () 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 friend_parseScienceDefinition (INI *ini)
 

Friends

class ScienceInfo
 

Additional Inherited Members

- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

Definition at line 79 of file Science.h.

Constructor & Destructor Documentation

◆ ~ScienceStore()

ScienceStore::~ScienceStore ( )
virtual

Definition at line 52 of file Science.cpp.

Member Function Documentation

◆ friend_getScienceNames()

std::vector< AsciiString > ScienceStore::friend_getScienceNames ( ) const

Definition at line 113 of file Science.cpp.

◆ friend_lookupScience()

ScienceType ScienceStore::friend_lookupScience ( const char * scienceName) const

Definition at line 359 of file Science.cpp.

◆ friend_parseScienceDefinition()

void ScienceStore::friend_parseScienceDefinition ( INI * ini)
static

Definition at line 162 of file Science.cpp.

◆ getInternalNameForScience()

AsciiString ScienceStore::getInternalNameForScience ( ScienceType science) const

Definition at line 101 of file Science.cpp.

◆ getNameAndDescription()

Bool ScienceStore::getNameAndDescription ( ScienceType st,
UnicodeString & name,
UnicodeString & description ) const

Definition at line 265 of file Science.cpp.

◆ getPurchasableSciences()

void ScienceStore::getPurchasableSciences ( const Player * player,
ScienceVec & purchasable,
ScienceVec & potentiallyPurchasable ) const

return a list of the sciences the given player can purchase now, and a list he might be able to purchase in the future, but currently lacks prereqs or points for. (either might be an empty list)

Definition at line 325 of file Science.cpp.

◆ getScienceFromInternalName()

ScienceType ScienceStore::getScienceFromInternalName ( const AsciiString & name) const

Definition at line 91 of file Science.cpp.

◆ getSciencePurchaseCost()

Int ScienceStore::getSciencePurchaseCost ( ScienceType science) const

Definition at line 237 of file Science.cpp.

◆ init()

void ScienceStore::init ( )
virtual
  • 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 45 of file Science.cpp.

◆ isScienceGrantable()

Bool ScienceStore::isScienceGrantable ( ScienceType st) const

Definition at line 251 of file Science.cpp.

◆ isValidScience()

Bool ScienceStore::isValidScience ( ScienceType st) const

Definition at line 372 of file Science.cpp.

◆ playerHasPrereqsForScience()

Bool ScienceStore::playerHasPrereqsForScience ( const Player * player,
ScienceType st ) const

Definition at line 281 of file Science.cpp.

◆ playerHasRootPrereqsForScience()

Bool ScienceStore::playerHasRootPrereqsForScience ( const Player * player,
ScienceType st ) const

this is a subtle call, and should ALMOST NEVER be called by external code... this is used to determine if you have the "root" requirements for a given science, and thus could potentially obtain it if you got extra prereqs.

Generally, you should call getPurchasableSciences() instead of this!

Definition at line 302 of file Science.cpp.

◆ reset()

void ScienceStore::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 69 of file Science.cpp.

◆ update()

void ScienceStore::update ( )
inlinevirtual
  • 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 88 of file Science.h.

Friends And Related Symbol Documentation

◆ ScienceInfo

friend class ScienceInfo
friend

Definition at line 81 of file Science.h.


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