#include <EconData.h>
Inheritance diagram for EconData:


Public Methods | |
| void | initData (istream &in) |
| Initialzes the data from a stream. | |
| int | unitAmount (int unitType) const |
| Gets the cost associated with each unit type. | |
| int | unitTrainingTime (int unitType) const |
| The time it takes a city to train a unit. | |
| DWORD | depositInterval () const |
| How frequently a city deposits money in a players bank. | |
| int | depositPerCity (int econLevel) const |
| How much money a city deposits. | |
| int | econUpgradeCost (int currentLevel) const |
| the cost to upgrade econ from currentLevel to next | |
| int | econUpgradeTime (int currentLevel) const |
| void | shutdown () |
| releases all resources | |
Static Public Methods | |
| EconData & | getObj () |
Static Public Attributes | |
| const string | TOK_BEGIN_DATA = "BEGIN ECON DATA" |
| Tokens that delimit the data in the data file. | |
| const string | TOK_END_DATA = "END ECON DATA" |
Static Protected Methods | |
| void | releaseObj () |
| should only be called by the class that inherits the Singleton functionality after the subclasses releases all its necessary resources | |
Private Attributes | |
| int | m_unitCosts [UnitTypes::COUNT] |
| int | m_unitTrainingTime [UnitTypes::COUNT] |
| DWORD | m_depositInterval |
| int | m_depositPerCity [5] |
| int | m_econUpgradeCost [5] |
| int | m_econUpgradeTime [5] |
|
|
How frequently a city deposits money in a players bank.
Definition at line 48 of file EconData.cpp. References DWORD, and m_depositInterval. Referenced by HUD::render(), and City::update().
00048 { return m_depositInterval; }
|
|
|
How much money a city deposits.
Definition at line 50 of file EconData.cpp. References m_depositPerCity. Referenced by HUD::render(), and City::update().
00050 { assert(econLevel>=1 && econLevel<=5); return m_depositPerCity[econLevel-1]; }
|
|
|
the cost to upgrade econ from currentLevel to next
Definition at line 54 of file EconData.cpp. References m_econUpgradeCost. Referenced by HUD::render().
00055 {
00056 assert(currentLevel>=1 && currentLevel<=5);
00057 return m_econUpgradeCost[currentLevel-1];
00058 }
|
|
|
Definition at line 60 of file EconData.cpp. References m_econUpgradeTime.
00061 {
00062 assert(currentLevel>=1 && currentLevel<=5);
00063 return m_econUpgradeTime[currentLevel-1];
00064 }
|
|
|
Referenced by Overhead::initData(), Overhead::overhead_shutdown(), HUD::render(), and City::update(). |
|
|
Initialzes the data from a stream.
Definition at line 26 of file EconData.cpp. References m_depositInterval, m_depositPerCity, m_econUpgradeCost, m_econUpgradeTime, m_unitCosts, and m_unitTrainingTime. Referenced by Overhead::initData().
00027 {
00028 for(int i=0; i < UnitTypes::COUNT; ++i)
00029 in >> m_unitCosts[i];
00030 for(int i=0; i < UnitTypes::COUNT; ++i)
00031 in >> m_unitTrainingTime[i];
00032
00033 in >> m_depositInterval;
00034 for( int level=1; level<=5; level++ )
00035 in >> m_depositPerCity[level-1];
00036
00037 for( int econLevel=1; econLevel<=5; econLevel++ )
00038 in >> m_econUpgradeCost[econLevel-1];
00039
00040 for( int econLevel=1; econLevel<=5; econLevel++ )
00041 in >> m_econUpgradeTime[econLevel-1];
00042 }
|
|
|
should only be called by the class that inherits the Singleton functionality after the subclasses releases all its necessary resources
Referenced by shutdown(). |
|
|
releases all resources
Definition at line 52 of file EconData.cpp. References Singleton< EconData >::releaseObj(). Referenced by Overhead::overhead_shutdown().
00052 { this->releaseObj(); }
|
|
|
Gets the cost associated with each unit type.
Definition at line 44 of file EconData.cpp. References m_unitCosts. Referenced by HUD::render().
00044 { return m_unitCosts[type]; }
|
|
|
The time it takes a city to train a unit.
Definition at line 46 of file EconData.cpp. References m_unitTrainingTime. Referenced by City::update().
00046 { return m_unitTrainingTime[type]; }
|
|
|
Definition at line 60 of file EconData.h. Referenced by depositInterval(), and initData(). |
|
|
Definition at line 61 of file EconData.h. Referenced by depositPerCity(), and initData(). |
|
|
Definition at line 62 of file EconData.h. Referenced by econUpgradeCost(), and initData(). |
|
|
Definition at line 63 of file EconData.h. Referenced by econUpgradeTime(), and initData(). |
|
|
Definition at line 58 of file EconData.h. Referenced by initData(), and unitAmount(). |
|
|
Definition at line 59 of file EconData.h. Referenced by initData(), and unitTrainingTime(). |
|
|
Tokens that delimit the data in the data file.
Definition at line 23 of file EconData.cpp. Referenced by Overhead::initData(). |
|
|
Definition at line 24 of file EconData.cpp. |
1.3-rc2