#include <constructbuildingcommand.h>
Inheritance diagram for ConstructBuildingCommand:

Public Types | |
| typedef vector< ConstructBuildingCommand::ProductionEntry > | Producables |
Public Member Functions | |
| ConstructBuildingCommand (Vehicle *unit) | |
| ActionResult | go (const Context &context) |
| ASCString | getCommandString () const |
| Lack | buildingProductionPrerequisites (const BuildingType *type) const |
| Producables | getProduceableBuildings () |
| void | setBuildingType (const BuildingType *type) |
| vector< MapCoordinate > | getFields () |
| bool | isFieldUsable (const MapCoordinate &pos) |
| Building * | getProducedBuilding () |
| void | setTargetPosition (const MapCoordinate &pos) |
Static Public Member Functions | |
| static bool | avail (const Vehicle *eht) |
Protected Member Functions | |
| void | readData (tnstream &stream) |
| void | writeData (tnstream &stream) const |
| GameActionID | getID () const |
| ASCString | getDescription () const |
| bool | buildingFits (const MapCoordinate &entry) |
Friends | |
| template<class Child> | |
| GameAction * | GameActionCreator (GameMap *map) |
Classes | |
| class | Lack |
| class | ProductionEntry |
Definition at line 32 of file constructbuildingcommand.h.
Definition at line 86 of file constructbuildingcommand.h.
| ConstructBuildingCommand::ConstructBuildingCommand | ( | Vehicle * | unit | ) |
Definition at line 58 of file constructbuildingcommand.cpp.
| bool ConstructBuildingCommand::avail | ( | const Vehicle * | eht | ) | [static] |
Definition at line 41 of file constructbuildingcommand.cpp.
References GameMap::actplayer, Vehicle::attacked, cgp_forbid_building_construction, ContainerBaseType::ConstructBuildings, GameMap::getgameparameter(), ContainerBase::getMap(), ContainerBase::getOwner(), ContainerBaseType::hasFunction(), Vehicle::hasMoved(), and Vehicle::typ.
Referenced by GuiFunctions::ConstructBuilding::available(), buildingProductionPrerequisites(), constructBuilding(), getProduceableBuildings(), and go().
| void ConstructBuildingCommand::readData | ( | tnstream & | stream | ) | [protected, virtual] |
Reimplemented from UnitCommand.
Definition at line 279 of file constructbuildingcommand.cpp.
References MapCoordinate::read(), UnitCommand::readData(), and tnstream::readInt().
| void ConstructBuildingCommand::writeData | ( | tnstream & | stream | ) | const [protected, virtual] |
Reimplemented from UnitCommand.
Definition at line 289 of file constructbuildingcommand.cpp.
References MapCoordinate::write(), UnitCommand::writeData(), and tnstream::writeInt().
| GameActionID ConstructBuildingCommand::getID | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 310 of file constructbuildingcommand.cpp.
References ActionRegistry::ConstructBuildingCommand.
| ASCString ConstructBuildingCommand::getDescription | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 315 of file constructbuildingcommand.cpp.
References GameMap::getbuildingtype_byid(), GameAction::getMap(), Vehicle::getName(), UnitCommand::getUnit(), ContainerBaseType::name, and MapCoordinate::toString().
| bool ConstructBuildingCommand::buildingFits | ( | const MapCoordinate & | entry | ) | [protected] |
Definition at line 132 of file constructbuildingcommand.cpp.
References TerrainAccess::accessible(), MapField::bdt, MapField::building, buildingTypeRepository, cbbuildingentry, chfahrend, BuildingType::fieldExists(), GameMap::getField(), BuildingType::getFieldCoordinate(), GameAction::getMap(), getTerrainBitType(), ContainerBaseType::height, and BuildingType::terrainaccess.
Referenced by getFields().
| ActionResult ConstructBuildingCommand::go | ( | const Context & | context | ) | [virtual] |
Implements Command.
Definition at line 213 of file constructbuildingcommand.cpp.
References ChangeUnitProperty::AttackedFlag, avail(), buildingProductionPrerequisites(), buildingTypeRepository, ActionRegistry::ChangeUnitMovement, ActionRegistry::ChangeUnitProperty, ActionRegistry::ConsumeResource, Context::display, GameAction::getMap(), Command::getState(), UnitCommand::getUnit(), isFieldUsable(), ConstructBuildingCommand::Lack::ok(), MapDisplayInterface::repaintDisplay(), Command::SetUp, ActionRegistry::SpawnBuilding, and ActionResult::successful().
| ASCString ConstructBuildingCommand::getCommandString | ( | ) | const [virtual] |
Implements Command.
Definition at line 303 of file constructbuildingcommand.cpp.
References ASCString::format(), UnitCommand::getUnitID(), MapCoordinate::x, and MapCoordinate::y.
| ConstructBuildingCommand::Lack ConstructBuildingCommand::buildingProductionPrerequisites | ( | const BuildingType * | type | ) | const |
Definition at line 79 of file constructbuildingcommand.cpp.
References avail(), TechAdapterDependency::available(), Resources::count, getFirstBit(), getheightdelta(), GameAction::getMap(), Vehicle::getResource(), UnitCommand::getUnit(), ContainerBaseType::height, ConstructBuildingCommand::Lack::Level, ConstructBuildingCommand::Lack::Research, Resources::resource(), and ContainerBaseType::techDependency.
Referenced by getProduceableBuildings(), and go().
| ConstructBuildingCommand::Producables ConstructBuildingCommand::getProduceableBuildings | ( | ) |
Definition at line 102 of file constructbuildingcommand.cpp.
References avail(), buildingProductionPrerequisites(), VehicleType::buildingsBuildable, buildingTypeRepository, UnitCommand::getUnit(), ContainerBaseType::id, and Vehicle::typ.
| void ConstructBuildingCommand::setBuildingType | ( | const BuildingType * | type | ) |
| vector< MapCoordinate > ConstructBuildingCommand::getFields | ( | ) |
Definition at line 175 of file constructbuildingcommand.cpp.
References buildingFits(), buildingTypeRepository, getNeighbouringFieldCoordinate(), Vehicle::getPosition(), and UnitCommand::getUnit().
Referenced by isFieldUsable().
| bool ConstructBuildingCommand::isFieldUsable | ( | const MapCoordinate & | pos | ) |
Definition at line 191 of file constructbuildingcommand.cpp.
References getFields().
Referenced by GuiFunctions::ConstructBuilding::available(), and go().
| Building * ConstructBuildingCommand::getProducedBuilding | ( | ) |
Definition at line 271 of file constructbuildingcommand.cpp.
| void ConstructBuildingCommand::setTargetPosition | ( | const MapCoordinate & | pos | ) |
Definition at line 198 of file constructbuildingcommand.cpp.
References GameMap::getField(), GameAction::getMap(), Command::setState(), and Command::SetUp.
Referenced by GuiFunctions::ConstructBuilding::execute().
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1