Advanced Strategic Command
Public Member Functions | Public Attributes | Friends | List of all members
Research Class Reference

#include <research.h>

Public Member Functions

ASCString listTriggeredTechAdapter () const
 
bool techResearched (int id) const
 
void read (tnstream &stream)
 
void write (tnstream &stream)
 
void read_struct (tnstream &stream, bool merge=false)
 
void read_techs (tnstream &stream, bool merge=false)
 
vector< ASCStringevalTechAdapter ()
 checks for TechAdapters whose preconditions are now satisfied. More...
 
bool techAdapterAvail (const ASCString &ta) const
 
void settechlevel (int techlevel)
 
void chainToMap (GameMap *_map, int _player)
 
vector< ASCStringaddanytechnology (const Technology *tech)
 adds the technology to the list of available technologies More...
 
ResearchAvailabilityStatus techAvailable (const Technology *tech) const
 
bool isBlocked (const Technology *tech) const
 
int getResearchPerTurn () const
 
int currentTechAvailableIn () const
 
void setMultiplier (int m)
 
int getMultiplier ()
 
const vector< ASCString > & getPredefinedTechAdapter ()
 
void setPredefinedTechAdapter (const set< ASCString > &adapter)
 
void addPredefinedTechAdapter (const ASCString &techAdapter)
 
 Research ()
 
void clear ()
 
 ~Research ()
 

Public Attributes

vector< int > developedTechnologies
 
int progress
 
const Technologyactivetechnology
 the technology that is currently being researched More...
 
const Technologygoal
 the technology that is defined as long-term goal More...
 
bool techsAvail
 is used by the chooseTechnology dialog: the first time no techs are available this variable is still true, so the dialog shows "no techs avail". More...
 

Friends

class DirectResearchCommand
 

Detailed Description

Definition at line 162 of file research.h.

Constructor & Destructor Documentation

Research::Research ( )

Definition at line 610 of file research.cpp.

References activetechnology, progress, and techsAvail.

Research::~Research ( )

Definition at line 933 of file research.cpp.

Member Function Documentation

vector< ASCString > Research::addanytechnology ( const Technology tech)

adds the technology to the list of available technologies

Returns
a list of TechAdapters that were activated due to this new technology

Definition at line 849 of file research.cpp.

References developedTechnologies, evalTechAdapter(), Technology::id, GameMap::player, and Player::queuedEvents.

Referenced by trunreplay::execnextreplaymove(), runResearch(), and settechlevel().

void Research::addPredefinedTechAdapter ( const ASCString techAdapter)

Definition at line 926 of file research.cpp.

void Research::chainToMap ( GameMap _map,
int  _player 
)
inline

Definition at line 211 of file research.h.

Referenced by GameMap::GameMap().

void Research::clear ( )

Definition at line 747 of file research.cpp.

References activetechnology, developedTechnologies, goal, and progress.

Referenced by Player::resetResearch().

int Research::currentTechAvailableIn ( ) const
vector< ASCString > Research::evalTechAdapter ( )

checks for TechAdapters whose preconditions are now satisfied.

These TechAdapters will be activated.

Returns
a list of TechAdapters that were activated

Definition at line 774 of file research.cpp.

References techAdapterContainer.

Referenced by addanytechnology(), read(), and settechlevel().

int Research::getMultiplier ( )
inline

Definition at line 232 of file research.h.

Referenced by doresearch(), and ResearchWindow::update().

const vector<ASCString>& Research::getPredefinedTechAdapter ( )
inline

Definition at line 234 of file research.h.

Referenced by EditTechAdapter::EditTechAdapter().

int Research::getResearchPerTurn ( ) const
bool Research::isBlocked ( const Technology tech) const
ASCString Research::listTriggeredTechAdapter ( ) const

Definition at line 790 of file research.cpp.

References techAdapterContainer.

Referenced by executeUserAction(), and researchinfo().

void Research::read ( tnstream stream)

Definition at line 621 of file research.cpp.

References evalTechAdapter(), read_struct(), and read_techs().

Referenced by GameMap::read().

void Research::read_struct ( tnstream stream,
bool  merge = false 
)
void Research::read_techs ( tnstream stream,
bool  merge = false 
)
void Research::setMultiplier ( int  m)
inline

Definition at line 231 of file research.h.

Referenced by GameMap::startGame().

void Research::setPredefinedTechAdapter ( const set< ASCString > &  adapter)

Definition at line 920 of file research.cpp.

Referenced by EditTechAdapter::ok().

void Research::settechlevel ( int  techlevel)
bool Research::techAdapterAvail ( const ASCString ta) const
ResearchAvailabilityStatus Research::techAvailable ( const Technology tech) const
bool Research::techResearched ( int  id) const
void Research::write ( tnstream stream)

Friends And Related Function Documentation

friend class DirectResearchCommand
friend

Definition at line 163 of file research.h.

Member Data Documentation

const Technology* Research::activetechnology
vector<int> Research::developedTechnologies
const Technology* Research::goal
int Research::progress
bool Research::techsAvail

is used by the chooseTechnology dialog: the first time no techs are available this variable is still true, so the dialog shows "no techs avail".

THen it sets techAvail to false, preventing the same message at the beginning of each turn

Definition at line 225 of file research.h.

Referenced by read_struct(), Research(), and write().


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