Research Class Reference

#include <research.h>

List of all members.

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.
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
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
const Technologygoal
 the technology that is defined as long-term goal
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".

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

ASCString Research::listTriggeredTechAdapter (  )  const

Definition at line 790 of file research.cpp.

References techAdapterContainer.

Referenced by executeUserAction(), and researchinfo().

bool Research::techResearched ( int  id  )  const

Definition at line 757 of file research.cpp.

References developedTechnologies.

Referenced by TechDependency::available(), Technology::eventually_available(), getNextTechnologyTowardsGoal(), runResearch(), settechlevel(), TechDependency::showDebug(), and techAvailable().

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::write ( tnstream stream  ) 

Definition at line 698 of file research.cpp.

References activetechnology, developedTechnologies, goal, Technology::id, progress, techsAvail, writeClassContainer(), and tnstream::writeInt().

Referenced by GameMap::write().

void Research::read_struct ( tnstream stream,
bool  merge = false 
)

Definition at line 634 of file research.cpp.

References activetechnology, developedTechnologies, tnstream::getLocation(), goal, progress, tnstream::readChar(), readClassContainer(), tnstream::readInt(), tnstream::readWord(), technologyRepository, and techsAvail.

Referenced by read(), and GameMap::read().

void Research::read_techs ( tnstream stream,
bool  merge = false 
)

Definition at line 717 of file research.cpp.

References activetechnology, developedTechnologies, Technology::id, tnstream::readInt(), and technologyRepository.

Referenced by tsavegameloaders::loadgame(), tnetworkloaders::loadnwgame(), and read().

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().

bool Research::techAdapterAvail ( const ASCString ta  )  const

Definition at line 766 of file research.cpp.

Referenced by TechAdapterDependency::available(), and TechAdapterDependency::showDebug().

void Research::settechlevel ( int  techlevel  ) 

Definition at line 861 of file research.cpp.

References addanytechnology(), evalTechAdapter(), Technology::id, Technology::techlevel, technologyRepository, and techResearched().

Referenced by tchoosetechlevel::run().

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

Definition at line 211 of file research.h.

Referenced by GameMap::GameMap().

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().

ResearchAvailabilityStatus Research::techAvailable ( const Technology tech  )  const

Definition at line 834 of file research.cpp.

References Available, TechDependency::available(), Technology::id, isBlocked(), NeverAvailable, Researched, Technology::techDependency, techResearched(), and UnavailableNow.

Referenced by anyTechAvailable(), and DirectResearchCommand::getAvailableTechnologies().

bool Research::isBlocked ( const Technology tech  )  const

Definition at line 818 of file research.cpp.

References developedTechnologies, Technology::id, and technologyRepository.

Referenced by Technology::eventually_available(), and techAvailable().

int Research::getResearchPerTurn (  )  const

Definition at line 896 of file research.cpp.

References Player::buildingList, GameMap::player, and Player::vehicleList.

Referenced by currentTechAvailableIn(), executeUserAction(), tresearchinfo::init(), and ResearchWindow::update().

int Research::currentTechAvailableIn (  )  const

Definition at line 908 of file research.cpp.

References activetechnology, getResearchPerTurn(), progress, and Technology::researchpoints.

Referenced by tresearchinfo::init(), and ResearchWindow::update().

void Research::setMultiplier ( int  m  )  [inline]

Definition at line 231 of file research.h.

Referenced by GameMap::startGame().

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().

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

Definition at line 920 of file research.cpp.

Referenced by EditTechAdapter::ok().

void Research::addPredefinedTechAdapter ( const ASCString techAdapter  ) 

Definition at line 926 of file research.cpp.

void Research::clear (  ) 

Definition at line 747 of file research.cpp.

References activetechnology, developedTechnologies, goal, and progress.

Referenced by Player::resetResearch().


Friends And Related Function Documentation

friend class DirectResearchCommand [friend]

Definition at line 163 of file research.h.


Member Data Documentation

vector<int> Research::developedTechnologies

Definition at line 183 of file research.h.

Referenced by addanytechnology(), clear(), compareMapResources(), editResearch(), executeUserAction(), isBlocked(), read_struct(), read_techs(), researchinfo(), techResearched(), DirectResearchCommand::undoAction(), and write().

int Research::progress

Definition at line 189 of file research.h.

Referenced by DirectResearchCommand::available(), checkForNewResearch(), ChooseTech::ChooseTech(), chooseTechnologyIfAvail(), clear(), compareMapResources(), currentTechAvailableIn(), doresearch(), editResearchPoints(), trunreplay::execnextreplaymove(), executeUserAction(), CancelResearchCommand::go(), tresearchinfo::init(), CancelResearchCommand::preCheck(), read_struct(), Research(), runResearch(), testresearch1(), testresearch2(), DirectResearchCommand::undoAction(), CancelResearchCommand::undoAction(), and write().

const Technology* Research::activetechnology

the technology that is currently being researched

Definition at line 191 of file research.h.

Referenced by DirectResearchCommand::available(), ChooseTech::cancel(), checkForNewResearch(), chooseTechnologyIfAvail(), clear(), currentTechAvailableIn(), doresearch(), executeUserAction(), DirectResearchCommand::go(), CancelResearchCommand::go(), tresearchinfo::init(), CancelResearchCommand::preCheck(), read_struct(), read_techs(), Research(), runResearch(), testresearch1(), testresearch2(), CancelResearchCommand::undoAction(), ResearchWindow::update(), and write().

const Technology* Research::goal

the technology that is defined as long-term goal

Definition at line 194 of file research.h.

Referenced by DirectResearchCommand::available(), ChooseTech::cancel(), clear(), getNextTechnologyTowardsGoal(), DirectResearchCommand::go(), CancelResearchCommand::go(), CancelResearchCommand::preCheck(), read_struct(), CancelResearchCommand::undoAction(), and write().

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:
Generated on Mon May 21 01:47:22 2012 for Advanced Strategic Command by  doxygen 1.5.1