#include <containerbase.h>
Inheritance diagram for ContainerBase:

Cargo related functions | |
| typedef vector< Vehicle * > | Cargo |
| const Cargo & | getCargo () const |
| void | clearCargo () |
| removes ALL units from cargo | |
| virtual int | getArmor () const =0 |
| void | addToCargo (Vehicle *veh) |
| bool | removeUnitFromCargo (Vehicle *veh, bool recursive=false) |
| removes the given unit from the container. true of the unit was found, false otherwise | |
| bool | removeUnitFromCargo (int nwid, bool recursive=false) |
| bool | unitLoaded (int nwid) |
| int | vehiclesLoaded (void) const |
| returns the number of loaded units | |
| ContainerBase * | getCarrier () const |
| if this is a unit and it is inside a building or transport, returns the transport. NULL otherwise. | |
| Vehicle * | findUnit (int nwid) const |
| searches for a the unit in the whole stack | |
| bool | vehicleLoadable (const Vehicle *vehicle, int uheight=-1, const bool *attacked=NULL) const |
| can the vehicle be loaded. | |
| int | vehicleUnloadable (const Vehicletype *vehicleType) const |
| returns the levels of height on which this unit can be unloaded; or 0 if no unloading is possible | |
| const ContainerBaseType::TransportationIO * | vehicleUnloadSystem (const Vehicletype *vehicle, int height) |
| returns the unloading system | |
| int | vehicleDocking (const Vehicle *vehicle, bool out) const |
| returns the levels of height on which this unit can be transfered by docking; or 0 if no unloading is possible | |
| bool | vehicleFit (const Vehicle *vehicle) const |
| Does the vehicle fit into the container? This does not include checking if it can reach the entry. | |
| int | cargoWeight () const |
| weight of all loaded units | |
| int | cargoNestingDepth () |
| returns the nesting depth of the cargo. The unit standing on the field is 0, its cargo is 1, the cargo's cargo 2 ... | |
| SigC::Signal0< void > | cargoChanged |
| Cargo | cargo |
Resource related functions | |
| virtual int | putResource (int amount, int resourcetype, bool queryonly, int scope=1, int player=-1)=0 |
| scope: 0 = local 1 = resource network 2 = global in all buildings 3 = map wide pool( used only internally! ) | |
| virtual int | getResource (int amount, int resourcetype, bool queryonly, int scope=1, int player=-1)=0 |
| virtual int | getAvailableResource (int amount, int resourcetype, int scope=1) const =0 |
| Resources | putResource (const Resources &res, bool queryonly, int scope=1, int player=-1) |
| Resources | getResource (const Resources &res, bool queryonly, int scope=1, int player=-1) |
| Resources | getResource (const Resources &res) const |
| Resources | getResourceUsage () |
| returns the resource that the building consumes for its operation. | |
| Resources | getResourcePlus () |
| Resources | getStorageCapacity () const |
| returns the local storage capacity for the given resource, which depends on the resource mode of the map. | |
| Resources | netResourcePlus () const |
| returns the amount of resources that the net which the building is connected to produces each turn | |
| Resources | plus |
| the Resources that are produced each turn | |
| Resources | maxplus |
| the maximum amount of Resources that the building can produce each turn in the ASC resource mode ; see also bi_resourceplus | |
| Resources | bi_resourceplus |
| the maximum amount of Resources that the building can produce each turn in the BI resource mode ; see also maxplus | |
Public Types | |
| typedef vector< const Vehicletype * > | Production |
Public Member Functions | |
| virtual bool | isBuilding () const =0 |
| virtual Surface | getImage () const =0 |
| const Production & | getProduction () const |
| Resources | getProductionCost (const Vehicletype *unit) const |
| void | deleteProductionLine (const Vehicletype *type) |
| void | deleteAllProductionLines () |
| void | addProductionLine (const Vehicletype *type) |
| void | setProductionLines (const Production &production) |
| int | getOwner () const |
| returns the player this vehicle/building belongs to | |
| Player & | getOwningPlayer () const |
| virtual void | convert (int player)=0 |
| virtual void | write (tnstream &stream, bool includeLoadedUnits=true)=0 |
| virtual void | read (tnstream &stream)=0 |
| virtual void | addview (void)=0 |
| virtual void | removeview (void)=0 |
| virtual bool | canRepair (const ContainerBase *item) const =0 |
| int | getMaxRepair (const ContainerBase *item) |
| int | getMaxRepair (const ContainerBase *item, int newDamage, Resources &cost, bool ignoreCost=false) |
| int | repairItem (ContainerBase *item, int newDamage=0) |
| virtual int | repairableDamage ()=0 |
| returns the amount of damate that can still be repaired this turn | |
| GameMap * | getMap () const |
| virtual int | getIdentification ()=0 |
| virtual int | getHeight () const =0 |
| returns the bitmapped level of height. Only one bit will be set, of course | |
| virtual ASCString | getName () const =0 |
| virtual int | getAmmo (int type, int num, bool queryOnly)=0 |
| virtual int | getAmmo (int type, int num) const =0 |
| virtual int | putAmmo (int type, int num, bool queryOnly)=0 |
| virtual int | maxAmmo (int type) const =0 |
| virtual void | endOwnTurn (void) |
| hook that is called when a player ends his turn | |
| virtual void | endAnyTurn (void) |
| hook that is called when any player (including owner) ends turn | |
| virtual void | endRound (void) |
| hook that is called the next round begins ( active player switching from player8 to player1 ) | |
| Work * | spawnWorkClasses (bool justQuery) |
| virtual MapCoordinate3D | getPosition () const =0 |
| virtual | ~ContainerBase () |
| virtual vector< MapCoordinate > | getCoveredFields ()=0 |
Static Public Member Functions | |
| static int | calcShadowDist (int binaryHeight) |
| static bool | registerWorkClassFactory (WorkClassFactory *wcf, bool ASCmode=true) |
Public Attributes | |
| const ContainerBaseType * | baseType |
| int | damage |
| int | color |
| SigC::Signal0< void > | conquered |
| SigC::Signal0< void > | destroyed |
| int | researchpoints |
| the current amount of research that the building conducts every turn | |
| int | maxresearchpoints |
Static Public Attributes | |
| static SigC::Signal1< void, ContainerBase * > | anyContainerDestroyed |
| static SigC::Signal1< void, ContainerBase * > | anyContainerConquered |
Protected Member Functions | |
| virtual const ResourceMatrix & | getRepairEfficiency (void)=0 |
| virtual void | postRepair (int oldDamage)=0 |
| is called after a repair is perfored. Vehicles use this to reduce their experience. | |
| void | paintField (const Surface &src, Surface &dest, SPoint pos, int dir, bool shaded, int shadowDist=-1) const |
| ContainerBase (const ContainerBaseType *bt, GameMap *map, int player) | |
Protected Attributes | |
| GameMap * | gamemap |
| ContainerBase * | cargoParent |
| Production | internalUnitProduction |
Classes | |
| class | Work |
| class | WorkClassFactory |
Definition at line 41 of file containerbase.h.
|
|
Definition at line 79 of file containerbase.h. |
|
|
Definition at line 61 of file containerbase.h. |
|
||||||||||||||||
|
|
Definition at line 556 of file containerbase.cpp. References anyContainerDestroyed, cargo, destroyed, GameMap::Destruction, gamemap, and GameMap::state. |
|
|
Definition at line 542 of file containerbase.cpp. References internalUnitProduction. Referenced by ContainerControls::buildProductionLine(), and AddProductionCapability::execute(). |
|
|
Definition at line 339 of file containerbase.cpp. References cargo, cargoChanged, cargoParent, and getPosition(). Referenced by copyBuildingData(), copyVehicleData(), trunreplay::execnextreplaymove(), CargoItemFactory::itemSelected(), ContainerControls::moveUnitDown(), BaseVehicleMovement::moveunitxy(), and ContainerControls::produceUnit(). |
|
|
|
|
|
Definition at line 244 of file containerbase.cpp. References chfahrend, and log2(). Referenced by MapDisplayPG::displayAddons(), MapDisplayPG::displayUnitMovement(), and paintField(). |
|
|
Implemented in Building, and Vehicle. Referenced by getMaxRepair(), and repairItem(). |
|
|
returns the nesting depth of the cargo. The unit standing on the field is 0, its cargo is 1, the cargo's cargo 2 ...
Definition at line 169 of file containerbase.cpp. References cargoNestingDepth(), and getCarrier(). Referenced by cargoNestingDepth(), and Vehicle::setMovement(). |
|
|
weight of all loaded units
Definition at line 158 of file containerbase.cpp. References cargo. Referenced by execuseraction2(), and Vehicle::weight(). |
|
|
removes ALL units from cargo
Definition at line 327 of file containerbase.cpp. References cargo, and cargoChanged. Referenced by TemporaryContainerStorage::restore(). |
|
|
|
|
|
Definition at line 536 of file containerbase.cpp. References internalUnitProduction. |
|
|
Definition at line 530 of file containerbase.cpp. References internalUnitProduction. Referenced by ContainerControls::removeProductionLine(). |
|
|
hook that is called when any player (including owner) ends turn
Reimplemented in Vehicle. Definition at line 617 of file containerbase.cpp. Referenced by Vehicle::endAnyTurn(). |
|
|
hook that is called when a player ends his turn
Reimplemented in Vehicle. Definition at line 592 of file containerbase.cpp. References baseType, cargo, ContainerBaseType::hasFunction(), ContainerControls::refillAmmo(), ContainerBaseType::TrainingCenter, ContainerControls::trainUnit(), and ContainerControls::unitTrainingAvailable(). Referenced by Vehicle::endOwnTurn(). |
|
|
hook that is called the next round begins ( active player switching from player8 to player1 )
Reimplemented in Building, and Vehicle. Definition at line 621 of file containerbase.cpp. Referenced by Vehicle::endRound(), and Building::endRound(). |
|
|
searches for a the unit in the whole stack
Definition at line 202 of file containerbase.cpp. References cargo. Referenced by vehicleFit(). |
|
||||||||||||
|
|
|
||||||||||||||||
|
Implemented in Building, and Vehicle. Referenced by ammoCounter(), ContainerControls::getammunition(), and CargoDialog::showAmmo(). |
|
|
|
|
||||||||||||||||
|
Implemented in Building, and Vehicle. Referenced by ammoCounter(), getResource(), and ContainerConstControls::unitProductionPrerequisites(). |
|
|
|
if this is a unit and it is inside a building or transport, returns the transport. NULL otherwise.
Definition at line 180 of file containerbase.cpp. References cargoParent. Referenced by Vehicle::ReactionFire::canPerformAttack(), cargoNestingDepth(), ContainerControls::moveUnitUpAvail(), AutoHarvestObjects::run(), and Vehicle::~Vehicle(). |
|
|
Implemented in Building, and Vehicle. Referenced by SolarPowerplant::getPlus(). |
|
|
returns the bitmapped level of height. Only one bit will be set, of course
Implemented in Building, and Vehicle. Referenced by ServiceChecker::check(), getheightdelta(), and paintField(). |
|
|
Implemented in Building, and Vehicle. Referenced by ContainerControls::buildProductionLine(), ContainerControls::destructUnit(), ContainerControls::fillResource(), and ContainerControls::removeProductionLine(). |
|
|
Implemented in Building, and Vehicle. Referenced by AmmoTransferWindow::AmmoTransferWindow(). |
|
|
||||||||||||||||||||
|
Definition at line 108 of file containerbase.cpp. References baseType, canRepair(), damage, getRepairEfficiency(), getResource(), ContainerBaseType::productionCost, repairableDamage(), Resources::resource(), and resourceTypeNum. |
|
|
Definition at line 102 of file containerbase.cpp. Referenced by VehicleService::FieldSearch::checkBuilding2Vehicle(), VehicleService::FieldSearch::checkVehicle2Vehicle(), and repairItem(). |
|
|
Implemented in Building, and Vehicle. Referenced by CargoDialog::CargoDialog(). |
|
|
|
Definition at line 639 of file containerbase.cpp. References getMap(). Referenced by GuiFunctions::ConstructBuilding::execute(), Building::getImage(), and DashboardPanel::painter(). |
|
|
|
|
Definition at line 524 of file containerbase.cpp. References baseType, and ContainerBaseType::productionEfficiency. Referenced by trunreplay::execnextreplaymove(), VehicleProduction_SelectionItemFactory::getCost(), ContainerControls::produceUnit(), and ContainerConstControls::unitProductionPrerequisites(). |
|
|
Implemented in Building, and Vehicle. Referenced by getMaxRepair(). |
|
|
Reimplemented in Vehicle. Definition at line 72 of file containerbase.cpp. References getAvailableResource(), Resources::resource(), and resourceNum. |
|
||||||||||||||||||||
|
Reimplemented in Building, and Vehicle. Definition at line 64 of file containerbase.cpp. References getResource(), Resources::resource(), and resourceNum. |
|
||||||||||||||||||||||||
|
|
Definition at line 646 of file containerbase.cpp. References ContainerBase::Work::getPlus(), and spawnWorkClasses(). Referenced by GetResourcePlus::checkbuilding(). |
|
|
returns the resource that the building consumes for its operation.
Definition at line 659 of file containerbase.cpp. References baseType, ContainerBase::Work::getUsage(), ContainerBaseType::hasFunction(), ContainerBaseType::Research, researchpoints, returnResourcenUseForResearch(), and spawnWorkClasses(). |
|
|
returns the local storage capacity for the given resource, which depends on the resource mode of the map.
Definition at line 674 of file containerbase.cpp. References GameMap::_resourcemode, baseType, gamemap, ContainerBaseType::getStorageCapacity(), and isBuilding(). Referenced by CargoGuiFunctions::RefuelUnitDialog::available(), CargoGuiFunctions::RefuelUnit::available(), ServiceChecker::check(), GetResourceCapacity::checkbuilding(), PutTribute::checkbuilding(), PutResource::checkbuilding(), VehicleService::FieldSearch::checkVehicle2Vehicle(), Vehicle::endRound(), StoringPosition::eventBlit(), Building::execnetcontrol(), Vehicle::fillMagically(), VehicleService::getServices(), UnitPropertyEditor::init(), BuildingValues::init(), CargoItemFactory::itemSelected(), Vehicle::putResource(), DashboardPanel::showUnitData(), and Vehicle::transform(). |
|
|
Implemented in Building, and Vehicle. Referenced by ServiceChecker::check(), getStorageCapacity(), internalAmmoTransferAvailable(), vehicleFit(), and vehicleLoadable(). |
|
|
Implemented in Building, and Vehicle. Referenced by ServiceChecker::check(), and AmmoTransferrable::getMax(). |
|
|
returns the amount of resources that the net which the building is connected to produces each turn
Definition at line 627 of file containerbase.cpp. References color, getMap(), getPosition(), ResourceChangeNet::getresource(), Resources::resource(), and resourceTypeNum. |
|
||||||||||||||||||||||||||||
|
Definition at line 256 of file containerbase.cpp. References MegaBlitter< BytesPerSourcePixel, BytesPerTargetPixel, SourceColorTransform, ColorMerger, SourcePixelSelector, TargetPixelSelector, MyColorConverter >::blit(), calcShadowDist(), chfahrend, chgetaucht, directionangle, gamemap, getHeight(), getOwner(), log2(), megaBlitter(), nullParam, and GameMap::player. Referenced by Vehicle::paint(), and Building::paintSingleField(). |
|
|
is called after a repair is perfored. Vehicles use this to reduce their experience.
|
|
||||||||||||||||
|
Implemented in Building, and Vehicle. Referenced by ContainerControls::fillAmmo(), and ContainerControls::produceAmmo(). |
|
||||||||||||||||||||
|
Reimplemented in Building, and Vehicle. Definition at line 55 of file containerbase.cpp. References putResource(), Resources::resource(), and resourceNum. |
|
||||||||||||||||||||||||
|
scope: 0 = local 1 = resource network 2 = global in all buildings 3 = map wide pool( used only internally! )
Implemented in Building, and Vehicle. Referenced by ContainerControls::destructUnit(), Vehicle::putResource(), putResource(), Building::putResource(), ResourceWatch::ResourceWatch(), MiningStation::run(), RegenerativePowerPlant::run(), and MatterConverter::run(). |
|
|
Implemented in Building, and Vehicle. Referenced by TemporaryContainerStorage::restore(). |
|
||||||||||||
|
Definition at line 685 of file containerbase.cpp. |
| ||||||||||||