#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< ASCString > | evalTechAdapter () |
| 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< ASCString > | addanytechnology (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 Technology * | activetechnology |
| the technology that is currently being researched | |
| const Technology * | goal |
| 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 |
Definition at line 162 of file research.h.
| Research::Research | ( | ) |
| Research::~Research | ( | ) |
Definition at line 933 of file research.cpp.
| 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().
checks for TechAdapters whose preconditions are now satisfied.
These TechAdapters will be 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] |
| vector< ASCString > Research::addanytechnology | ( | const Technology * | tech | ) |
adds the technology to the list of available technologies
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] |
| int Research::getMultiplier | ( | ) | [inline] |
Definition at line 232 of file research.h.
Referenced by doresearch(), and ResearchWindow::update().
| void Research::setPredefinedTechAdapter | ( | const set< ASCString > & | adapter | ) |
| 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().
friend class DirectResearchCommand [friend] |
Definition at line 163 of file research.h.
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().
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().
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().
1.5.1