#include <buildings.h>
Inheritance diagram for Building:

Public Member Functions | |
| Building (GameMap *map, const MapCoordinate &entryPosition, const BuildingType *type, int player, bool setupImages=true, bool chainToField=true) | |
| bool | canRepair (const ContainerBase *item) const |
| void | write (tnstream &stream, bool includeLoadedUnits=true) |
| void | read (tnstream &stream) |
| void | execnetcontrol (void) |
| executes the resource net operations, like filling the tanks with fuel. | |
| int | putResource (int amount, int resourcetype, bool queryonly, int scope=1, int player=-1) |
| scope: 0 = local 1 = resource network 2 = global in all buildings 3 = map wide pool( used only internally! ) | |
| int | getResource (int amount, int resourcetype, bool queryonly, int scope=1, int player=-1) |
| int | getAvailableResource (int amount, int resourcetype, int scope=1) const |
| 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) |
| int | getIdentification () |
| const Surface & | getPicture (const BuildingType::LocalCoordinate &localCoordinate) const |
| returns the picture of the building. It may depend on the current weather of the fields the building is standing on | |
| void | paintSingleField (Surface &s, SPoint imgpos, BuildingType::LocalCoordinate pos) const |
| virtual Surface | getImage () const |
| bool | isBuilding () const |
| void | convert (int player) |
| changes the building's owner. | |
| void | addview () |
| Adds the view and jamming of the building to the player's global radar field. | |
| void | removeview () |
| Removes the view and jamming of the building from the player's global radar field. | |
| int | getArmor () const |
| returns the armor of the building. | |
| tfield * | getEntryField () const |
| returns the field the buildings entry is standing on | |
| MapCoordinate3D | getEntry () const |
| returns the position of the buildings entry | |
| tfield * | getField (const BuildingType::LocalCoordinate &localCoordinates) const |
| returns the pointer to the field which the given part of the building is standing on | |
| MapCoordinate | getFieldCoordinates (const BuildingType::LocalCoordinate &localCoordinates) const |
| returns the absolute map coordinate of the given part of the building | |
| BuildingType::LocalCoordinate | getLocalCoordinate (const MapCoordinate &field) const |
| converts a global coordinate into a local coordinate. | |
| MapCoordinate3D | getPosition () const |
| returns the position of the buildings entry | |
| MapCoordinate3D | getPosition3D () const |
| returns the position of the buildings entry | |
| int | chainbuildingtofield (const MapCoordinate &entryPos, bool setupImages=true) |
| registers the building at the given position on the map | |
| int | unchainbuildingfromfield (void) |
| unregister the building from the map position | |
| int | getCompletion () const |
| returns the completion of the building. | |
| void | setCompletion (int completion, bool setupImages=true) |
| Sets the level of completion of the building. | |
| void | endRound (void) |
| hook that is called when a turn ends | |
| ASCString | getName () const |
| returns a name for the building. If the building itself has a name, it will be returned. If it doesn't, the name of the building type will be returned. | |
| int | getAmmo (int type, int num, bool queryOnly) |
| int | getAmmo (int type, int num) const |
| int | putAmmo (int type, int num, bool queryOnly) |
| int | maxAmmo (int type) const |
| int | getHeight () const |
| returns the bitmapped level of height. Only one bit will be set, of course | |
| ~Building () | |
| virtual int | repairableDamage () |
| returns the amount of damate that can still be repaired this turn | |
| int | getMemoryFootprint () const |
Static Public Member Functions | |
| static Building * | newFromStream (GameMap *gamemap, tnstream &stream, bool chainToField=true) |
Public Attributes | |
| const BuildingType * | typ |
| int | ammo [waffenanzahl] |
| the ammo that is stored in the building | |
| ASCString | name |
| the building's name | |
| int | netcontrol |
| a bitmapped variable containing the status of the resource-net connection. | |
| int | connection |
| bitmapped: are there events that are triggered by actions affecting this building | |
| bool | visible |
| is the building visible? Building can be made invisible, but this feature should be used only in some very special cases | |
| AiValue * | aiparam [8] |
| int | lastmineddist |
| Resources | actstorage |
| the current storage of Resources | |
Protected Member Functions | |
| const ResourceMatrix & | getRepairEfficiency (void) |
| virtual void | postRepair (int oldDamage) |
| is called after a repair is perfored. Vehicles use this to reduce their experience. | |
| vector< MapCoordinate > | getCoveredFields () |
Protected Attributes | |
| int | repairedThisTurn |
| the percantage that this build has already been repaired this turn. The maximum percentage may be limited by a gameparameter | |
| ResourceMatrix | repairEfficiency |
Friends | |
| class | tprocessminingfields |
Definition at line 34 of file buildings.h.
|
||||||||||||||||||||||||||||
|
Definition at line 45 of file buildings.cpp. References aiparam, ammo, Player::buildingList, chainbuildingtofield(), connection, ContainerBase::damage, ContainerBaseType::defaultProduction, ContainerBase::gamemap, lastmineddist, netcontrol, GameMap::player, ContainerBase::plus, repairedThisTurn, typ, visible, and waffenanzahl. Referenced by newFromStream(). |
|
|
Definition at line 416 of file buildings.cpp. References Player::buildingList, ContainerBase::color, ContainerBase::gamemap, GameMap::player, and unchainbuildingfromfield(). |
|
|
Adds the view and jamming of the building to the player's global radar field.
Implements ContainerBase. Definition at line 332 of file buildings.cpp. References ContainerBase::gamemap, tcomputebuildingview::init(), and SearchFields::startsearch(). Referenced by convert(), and Reinforcements::execute(). |
|
|
Implements ContainerBase. Definition at line 91 of file buildings.cpp. References ContainerBaseType::ExternalRepair, ContainerBaseType::hasFunction(), ContainerBaseType::InternalUnitRepair, and typ. Referenced by VehicleService::FieldSearch::checkBuilding2Vehicle(). |
|
||||||||||||
|
registers the building at the given position on the map
Definition at line 238 of file buildings.cpp. References tfield::bdt, tfield::building, GameMap::calculateAllObjects(), ContainerBase::cargo, cbbuildingentry, BuildingType::entry, BuildingType::fieldExists(), ContainerBase::gamemap, getField(), getFieldCoordinates(), getLocalCoordinate(), getTerrainBitType(), tfield::objects, typ, tfield::vehicle, warning(), BuildingType::LocalCoordinate::x, MapCoordinate::x, BuildingType::LocalCoordinate::y, and MapCoordinate::y. Referenced by Building(), Reinforcements::execute(), movebuilding(), ClipBoardBase::place(), and transformMap(). |
|
|
changes the building's owner.
Implements ContainerBase. Definition at line 103 of file buildings.cpp. References actstorage, addview(), ContainerBase::anyContainerConquered, GameMap::bi_resource, Player::buildingList, ContainerBase::cargo, cnet_stopenergyinput, ContainerBase::color, ContainerBase::conquered, fatalError(), ContainerBase::gamemap, ContainerBase::getOwner(), ContainerBaseType::hasFunction(), GameMap::isResourceGlobal(), netcontrol, GameMap::player, putResource(), removeview(), Resources::resource(), ContainerBaseType::SelfDestructOnConquer, and typ. Referenced by trunreplay::execnextreplaymove(), ChangeBuildingOwner::execute(), BaseVehicleMovement::moveunitxy(), and tgiveunitawaydlg::run(). |
|
|
hook that is called when a turn ends
Reimplemented from ContainerBase. Definition at line 736 of file buildings.cpp. References ContainerBase::endRound(), and repairedThisTurn. |
|
|
executes the resource net operations, like filling the tanks with fuel.
Definition at line 541 of file controls.cpp. References actmap, actstorage, cnet_moveenergyout, cnet_stopenergyinput, cnet_stopenergyoutput, cnet_storeenergy, getResource(), ContainerBase::getStorageCapacity(), GameMap::isResourceGlobal(), netcontrol, npop, npush, putResource(), and Resources::resource(). |
|
||||||||||||
|
Implements ContainerBase. Definition at line 716 of file buildings.cpp. References ammo, assert, min(), and waffenanzahl. |
|
||||||||||||||||
|
Implements ContainerBase. Definition at line 705 of file buildings.cpp. References ammo, assert, min(), and waffenanzahl. |
|
|
returns the armor of the building.
Implements ContainerBase. Definition at line 356 of file buildings.cpp. References BuildingType::_armor, cgp_buildingarmor, ContainerBase::gamemap, GameMap::getgameparameter(), and typ. Referenced by tunitattacksbuilding::setup(), and DashboardPanel::showUnitData(). |
|
||||||||||||||||
|
Implements ContainerBase. Definition at line 607 of file controls.cpp. References ContainerBase::getMap(), StaticResourceNet::getresource(), MapCoordinate::x, and MapCoordinate::y. Referenced by DashboardPanel::showUnitData(). |
|
|
returns the completion of the building.
Definition at line 148 of file buildings.h. Referenced by destructbuildinglevel2(), trunreplay::execnextreplaymove(), tcomputebuildingview::init(), putbuilding2(), and write(). |
|
|
Implements ContainerBase. Definition at line 743 of file buildings.cpp. References BuildingType::fieldExists(), getFieldCoordinates(), and typ. |
|
|
returns the position of the buildings entry
Definition at line 373 of file buildings.cpp. References BuildingType::buildingheight, and typ. Referenced by PutResource::checkbuilding(), VehicleService::FieldSearch::checkBuilding2Vehicle(), VehicleService::execute(), getPosition(), getPosition3D(), tcomputebuildingview::init(), VehicleService::FieldSearch::init(), movebuilding(), PutTribute::puttribute(), transformMap(), and write(). |
|
|
returns the field the buildings entry is standing on
Definition at line 368 of file buildings.cpp. References BuildingType::entry, getField(), and typ. Referenced by SearchReconquerBuilding::canUnitCapture(), and MapNetwork::searchbuilding(). |
|
|
returns the pointer to the field which the given part of the building is standing on
Definition at line 362 of file buildings.cpp. References ContainerBase::gamemap, GameMap::getField(), and getFieldCoordinates(). Referenced by chainbuildingtofield(), getEntryField(), getPicture(), BuildingSeen::getState(), tcomputebuildingview::init(), tfield::setparams(), and unchainbuildingfromfield(). |
|
|
returns the absolute map coordinate of the given part of the building
Definition at line 380 of file buildings.cpp. References BuildingType::getFieldCoordinate(), and typ. Referenced by chainbuildingtofield(), getCoveredFields(), getField(), and MapNetwork::searchbuilding(). |
|
|
returns the bitmapped level of height. Only one bit will be set, of course
Implements ContainerBase. Definition at line 170 of file buildings.h. References BuildingType::buildingheight, and typ. Referenced by paintSingleField(). |
|
|
Implements ContainerBase. Definition at line 98 of file buildings.cpp. References getPosition(). Referenced by compareMapResources(). |
|
|
Implements ContainerBase. Definition at line 199 of file buildings.cpp. References ASC_max(), ASC_min(), Surface::createSurface(), fielddisthalfx, fielddistx, fielddisty, BuildingType::fieldExists(), fieldsizex, fieldsizey, ContainerBase::getOwningPlayer(), maxint, BuildingType::paint(), Surface::transparent, and typ. |
|
|
converts a global coordinate into a local coordinate.
Definition at line 386 of file buildings.cpp. References BuildingType::getLocalCoordinate(), and typ. Referenced by chainbuildingtofield(), and MapRenderer::paintSingleField(). |
|
|
Definition at line 754 of file buildings.cpp. |
|
|
returns a name for the building. If the building itself has a name, it will be returned. If it doesn't, the name of the building type will be returned.
Implements ContainerBase. Definition at line 697 of file buildings.cpp. References ContainerBaseType::name, name, and typ. |
|
|
returns the picture of the building. It may depend on the current weather of the fields the building is standing on
Definition at line 158 of file buildings.cpp. References getField(), BuildingType::getPicture(), tfield::getweather(), and typ. Referenced by paintSingleField(). |
|
|
returns the position of the buildings entry
Implements ContainerBase. Definition at line 136 of file buildings.h. References getEntry(). Referenced by compareMapResources(), Reinforcements::execute(), and getIdentification(). |
|
|
returns the position of the buildings entry
Definition at line 348 of file buildings.cpp. References getEntry(), MapCoordinate3D::setnum(), MapCoordinate::x, and MapCoordinate::y. |
|
|
Implements ContainerBase. Definition at line 181 of file buildings.h. References repairEfficiency. |
|
||||||||||||||||||||
|
Reimplemented from ContainerBase. Definition at line 87 of file buildings.h. References ContainerBase::getResource(). |
|
||||||||||||||||||||||||
|
Implements ContainerBase. Definition at line 590 of file controls.cpp. References ContainerBase::getMap(), StaticResourceNet::getresource(), putResource(), MapCoordinate::x, and MapCoordinate::y. Referenced by compareMapResources(), doresearch(), execnetcontrol(), trunreplay::execnextreplaymove(), VehicleService::execute(), putResource(), VehicleService::FieldSearch::run(), and PutTribute::start(). |
|
|
Implements ContainerBase. Definition at line 104 of file buildings.h. |
|
|
Implements ContainerBase. Definition at line 166 of file buildings.h. References maxint. |
|
||||||||||||||||
|
Definition at line 519 of file buildings.cpp. References ContainerBase::bi_resourceplus, Building(), ContainerBase::color, GameMap::getbuildingtype_byid(), tnstream::getDeviceName(), tnstream::readChar(), readData(), tnstream::readInt(), tnstream::readWord(), Resources::resource(), and typ. Referenced by Reinforcements::execute(), ClipBoardBase::place(), and tspfldloaders::readfields(). |
|
||||||||||||||||
|
Definition at line 168 of file buildings.cpp. References chfahrend, getHeight(), getPicture(), and ContainerBase::paintField(). Referenced by MapRenderer::paintSingleField(). |
|
|
is called after a repair is perfored. Vehicles use this to reduce their experience.
Implements ContainerBase. Definition at line 86 of file buildings.cpp. References ContainerBase::damage, and repairedThisTurn. |
|
||||||||||||||||
|
Implements ContainerBase. Definition at line 723 of file buildings.cpp. References ammo, assert, and waffenanzahl. |
|
||||||||||||||||||||
|
Reimplemented from ContainerBase. Definition at line 86 of file buildings.h. References ContainerBase::putResource(). |
|
||||||||||||||||||||||||
|
scope: 0 = local 1 = resource network 2 = global in all buildings 3 = map wide pool( used only internally! )
Implements ContainerBase. Definition at line 573 of file controls.cpp. References ContainerBase::getMap(), StaticResourceNet::getresource(), getResource(), MapCoordinate::x, and MapCoordinate::y. Referenced by convert(), destructbuildinglevel2(), execnetcontrol(), trunreplay::execnextreplaymove(), AddResources::execute(), getResource(), and VehicleService::FieldSearch::run(). |
|
|
Implements ContainerBase. Definition at line 563 of file buildings.cpp. References ContainerBase::bi_resourceplus, and Resources::resource(). |
|
|
Removes the view and jamming of the building from the player's global radar field.
Implements ContainerBase. Definition at line 339 of file buildings.cpp. References ContainerBase::color, ContainerBase::gamemap, tcomputebuildingview::init(), and SearchFields::startsearch(). Referenced by convert(). |
|
|
returns the amount of damate that can still be repaired this turn
Implements ContainerBase. Definition at line 76 of file buildings.cpp. References cgp_maxbuildingrepair, ContainerBase::damage, ContainerBase::getMap(), and repairedThisTurn. |
|
||||||||||||
|
Sets the level of completion of the building.
Definition at line 229 of file buildings.cpp. Referenced by destructbuildinglevel2(), trunreplay::execnextreplaymove(), putbuilding(), and putbuilding2(). |
|
|
unregister the building from the map position
Definition at line 300 of file buildings.cpp. References actmap, tfield::addobject(), tfield::bdt, tfield::building, cbbuildingentry, GameMap::Destruction, BuildingType::destructionObjects, BuildingType::fieldExists(), ContainerBase::gamemap, getField(), GameMap::getobjecttype_byid(), getTerrainBitType(), GameMap::state, and typ. Referenced by movebuilding(), transformMap(), and ~Building(). |
|
||||||||||||
|
|
Definition at line 39 of file buildings.h. |
|
|
the current storage of Resources
Definition at line 87 of file buildings.h. Referenced by PutTribute::checkbuilding(), PutResource::checkbuilding(), convert(), copyBuildingData(), destructbuildinglevel2(), execnetcontrol(), trunreplay::execnextreplaymove(), BuildingValues::init(), putbuilding2(), and write(). |
|
|
Definition at line 64 of file buildings.h. Referenced by Building(), and SearchReconquerBuilding::unitfound(). |
|
|
the ammo that is stored in the building
Definition at line 49 of file buildings.h. Referenced by Building(), VehicleService::FieldSearch::checkBuilding2Vehicle(), copyBuildingData(), VehicleService::execute(), getAmmo(), BuildingValues::init(), putAmmo(), and write(). |
|
|
bitmapped: are there events that are triggered by actions affecting this building
Definition at line 58 of file buildings.h. Referenced by Building(), evaluatevisibilityfield(), and putbuilding2(). |
|
|
Definition at line 68 of file buildings.h. Referenced by Building(), and copyBuildingData(). |
|
|
the building's name
Definition at line 52 of file buildings.h. Referenced by copyBuildingData(), getName(), BuildingValues::init(), DashboardPanel::showUnitData(), and write(). |
|
|
a bitmapped variable containing the status of the resource-net connection.
Definition at line 55 of file buildings.h. Referenced by Building(), GetResourceCapacity::checkbuilding(), PutTribute::checkbuilding(), PutResource::checkbuilding(), convert(), copyBuildingData(), destructbuildinglevel2(), execnetcontrol(), trunreplay::execnextreplaymove(), putbuilding2(), and write(). |
|
|
the percantage that this build has already been repaired this turn. The maximum percentage may be limited by a gameparameter
Definition at line 43 of file buildings.h. Referenced by Building(), endRound(), postRepair(), repairableDamage(), and write(). |
|
|
Definition at line 180 of file buildings.h. Referenced by getRepairEfficiency(). |
|
|
|
is the building visible? Building can be made invisible, but this feature should be used only in some very special cases
Definition at line 61 of file buildings.h. Referenced by Building(), copyBuildingData(), BuildingValues::init(), MapRenderer::paintSingleField(), putbuilding2(), and write(). |
1.4.2