#include <constructunitcommand.h>
Inheritance diagram for ConstructUnitCommand:

Public Types | ||||
| enum | Mode { undefined, internal, external } | |||
| typedef vector< ConstructUnitCommand::ProductionEntry > | Producables | |||
Public Member Functions | ||||
| ConstructUnitCommand (ContainerBase *unit) | ||||
| void | setMode (Mode mode) | |||
| ActionResult | go (const Context &context) | |||
| ASCString | getCommandString () const | |||
| Lack | unitProductionPrerequisites (const VehicleType *type) const | |||
| void | setVehicleType (const VehicleType *type) | |||
| Producables | getProduceableVehicles () | |||
| ||||
| vector< MapCoordinate > | getFields () | |||
| bool | isFieldUsable (const MapCoordinate &pos) | |||
| Vehicle * | getProducedUnit () | |||
| void | setTargetPosition (const MapCoordinate &pos) | |||
Static Public Member Functions | ||||
| static bool | externalConstructionAvail (const ContainerBase *eht) | |||
| static bool | internalConstructionAvail (const ContainerBase *eht) | |||
| static bool | avail (const ContainerBase *eht) | |||
Protected Member Functions | ||||
| void | readData (tnstream &stream) | |||
| void | writeData (tnstream &stream) const | |||
| GameActionID | getID () const | |||
| ASCString | getDescription () const | |||
Friends | ||||
| template<class Child> | ||||
| GameAction * | GameActionCreator (GameMap *map) | |||
Classes | ||||
| class | Lack | |||
| class | ProductionEntry | |||
Definition at line 32 of file constructunitcommand.h.
Definition at line 90 of file constructunitcommand.h.
| ConstructUnitCommand::ConstructUnitCommand | ( | ContainerBase * | unit | ) |
Definition at line 71 of file constructunitcommand.cpp.
| bool ConstructUnitCommand::externalConstructionAvail | ( | const ContainerBase * | eht | ) | [static] |
Definition at line 41 of file constructunitcommand.cpp.
References GameMap::actplayer, Vehicle::attacked, GameMap::getField(), ContainerBase::getMap(), ContainerBase::getOwner(), Vehicle::getPosition(), Vehicle::typ, MapField::vehicle, and VehicleType::vehiclesBuildable.
Referenced by avail(), and GuiFunctions::BuildVehicleCommand::available().
| bool ConstructUnitCommand::internalConstructionAvail | ( | const ContainerBase * | eht | ) | [static] |
Definition at line 56 of file constructunitcommand.cpp.
References GameMap::actplayer, ContainerBase::baseType, ContainerBase::getMap(), ContainerBase::getOwner(), ContainerBaseType::hasFunction(), ContainerBaseType::InternalVehicleProduction, ContainerBaseType::maxLoadableUnits, and ContainerBase::vehiclesLoaded().
Referenced by avail(), and CargoGuiFunctions::UnitProduction::available().
| bool ConstructUnitCommand::avail | ( | const ContainerBase * | eht | ) | [static] |
Definition at line 65 of file constructunitcommand.cpp.
References externalConstructionAvail(), and internalConstructionAvail().
Referenced by constructUnit().
| void ConstructUnitCommand::readData | ( | tnstream & | stream | ) | [protected, virtual] |
Reimplemented from ContainerCommand.
Definition at line 317 of file constructunitcommand.cpp.
References MapCoordinate::read(), ContainerCommand::readData(), and tnstream::readInt().
| void ConstructUnitCommand::writeData | ( | tnstream & | stream | ) | const [protected, virtual] |
Reimplemented from ContainerCommand.
Definition at line 329 of file constructunitcommand.cpp.
References MapCoordinate::write(), ContainerCommand::writeData(), and tnstream::writeInt().
| GameActionID ConstructUnitCommand::getID | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 360 of file constructunitcommand.cpp.
References ActionRegistry::ConstructUnitCommand.
| ASCString ConstructUnitCommand::getDescription | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 365 of file constructunitcommand.cpp.
References ContainerCommand::getContainer(), GameAction::getMap(), ContainerBase::getName(), GameMap::getvehicletype_byid(), ContainerBaseType::name, and MapCoordinate::toString().
| void ConstructUnitCommand::setMode | ( | Mode | mode | ) |
Definition at line 307 of file constructunitcommand.cpp.
References ContainerCommand::getContainer(), ContainerBase::getPosition(), and internal.
Referenced by CargoGuiFunctions::UnitProduction::execute().
| ActionResult ConstructUnitCommand::go | ( | const Context & | context | ) | [virtual] |
Implements Command.
Definition at line 192 of file constructunitcommand.cpp.
References GameMap::actplayer, Vehicle::attacked, ChangeUnitProperty::AttackedFlag, Player::buildingList, cgp_bi3_training, ActionRegistry::ChangeUnitMovement, ActionRegistry::ChangeUnitProperty, ActionRegistry::ConsumeResource, Context::display, GameAction::execute(), Vehicle::experience, external, Command::Failed, Command::Finished, ContainerCommand::getContainer(), GameMap::getgameparameter(), GameAction::getMap(), getProduceableVehicles(), Command::getState(), SpawnUnit::getUnit(), ContainerBaseType::height, isFieldUsable(), Vehicle::maxMovement(), maxunitexperience, Vehicle::networkid, GameMap::player, MapDisplayInterface::repaintDisplay(), Command::setState(), Command::SetUp, ActionRegistry::SpawnUnit, ActionResult::successful(), ContainerBaseType::TrainingCenter, Vehicle::typ, and VehicleType::unitConstructionMoveCostPercentage.
| ASCString ConstructUnitCommand::getCommandString | ( | ) | const [virtual] |
Implements Command.
Definition at line 353 of file constructunitcommand.cpp.
References ASCString::format(), ContainerCommand::getContainerID(), MapCoordinate::x, and MapCoordinate::y.
| ConstructUnitCommand::Lack ConstructUnitCommand::unitProductionPrerequisites | ( | const VehicleType * | type | ) | const |
Definition at line 79 of file constructunitcommand.cpp.
References TechAdapterDependency::available(), cgp_produceOnlyResearchedStuffExternally, cgp_produceOnlyResearchedStuffInternally, external, ContainerCommand::getContainer(), Vehicle::getExternalVehicleConstructionCost(), GameMap::getgameparameter(), GameAction::getMap(), Vehicle::getMovement(), ContainerBase::getProductionCost(), internal, Vehicle::maxMovement(), ConstructUnitCommand::Lack::Movement, ContainerBaseType::ProduceNonLeavableUnits, ConstructUnitCommand::Lack::Research, Resources::resource(), resourceTypeNum, ContainerBaseType::techDependency, Vehicle::typ, VehicleType::unitConstructionMoveCostPercentage, and ConstructUnitCommand::Lack::Unloadability.
Referenced by getProduceableVehicles().
| void ConstructUnitCommand::setVehicleType | ( | const VehicleType * | type | ) |
Definition at line 339 of file constructunitcommand.cpp.
References GameAction::getMap(), GameMap::getvehicletype_byid(), ContainerBaseType::id, Command::setState(), Command::SetUp, undefined, and MapCoordinate::valid().
| ConstructUnitCommand::Producables ConstructUnitCommand::getProduceableVehicles | ( | ) |
| internally,: | true for internal production (inside cargo bay), false for outside production(neighbouring field) |
Definition at line 114 of file constructunitcommand.cpp.
References cgp_forbid_unitunit_construction, GameMap::UnitProduction::check(), external, ContainerCommand::getContainer(), Vehicle::getExternalVehicleConstructionCost(), GameMap::getgameparameter(), ContainerBase::getMap(), ContainerBase::getProduction(), GameMap::getvehicletype_byid(), internal, Vehicle::typ, GameMap::unitProduction, unitProductionPrerequisites(), and VehicleType::vehiclesBuildable.
Referenced by go().
| vector< MapCoordinate > ConstructUnitCommand::getFields | ( | ) |
Definition at line 157 of file constructunitcommand.cpp.
References circularFieldIterator(), ContainerCommand::getContainer(), ContainerBase::getMap(), Vehicle::getPosition(), Vehicle::typ, VehicleType::unitConstructionMaxDistance, and VehicleType::unitConstructionMinDistance.
Referenced by isFieldUsable().
| bool ConstructUnitCommand::isFieldUsable | ( | const MapCoordinate & | pos | ) |
Definition at line 170 of file constructunitcommand.cpp.
References getFields().
Referenced by GuiFunctions::BuildVehicleCommand::available(), and go().
| Vehicle * ConstructUnitCommand::getProducedUnit | ( | ) |
Definition at line 299 of file constructunitcommand.cpp.
References GameAction::getMap(), and GameMap::getUnit().
Referenced by CargoGuiFunctions::UnitProduction::execute().
| void ConstructUnitCommand::setTargetPosition | ( | const MapCoordinate & | pos | ) |
Definition at line 177 of file constructunitcommand.cpp.
References GameMap::getField(), GameAction::getMap(), Command::setState(), Command::SetUp, and undefined.
Referenced by GuiFunctions::BuildVehicleCommand::execute().
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1