Advanced Strategic Command
|
The class describing properties that are common to all buildings of a certain kind. More...
#include <buildingtype.h>
Classes | |
class | LocalCoordinate |
A local coordinate referencing a single field that a building covers. More... | |
Public Member Functions | |
void | convertOldFunctions (int abilities, const ASCString &location) |
the method for specifying a building's abilility was change at some point in time. More... | |
int | getMoveMalusType () const |
const Surface & | getPicture (const LocalCoordinate &localCoordinate, int weather=0, int constructionStep=0) const |
void | paint (Surface &s, SPoint pos, const PlayerColor &player, int weather=0, int constructionStep=0) const |
void | paint (Surface &s, SPoint pos) const |
void | paintSingleField (Surface &s, SPoint pos, const LocalCoordinate &localCoordinate, const PlayerColor &player, int weather=0, int constructionStep=0) const |
void | paintSingleField (Surface &s, SPoint pos, const LocalCoordinate &localCoordinate, int weather=0, int constructionStep=0) const |
int | getBIPicture (const LocalCoordinate &localCoordinate, int weather=0, int constructionStep=0) const |
bool | fieldExists (const LocalCoordinate &localCoordinate) const |
returns whether this building covers the given field More... | |
BuildingType (void) | |
MapCoordinate | getFieldCoordinate (const MapCoordinate &entryOnMap, const LocalCoordinate &localCoordinate) const |
returns the Mapcoordinate of a buildings field More... | |
LocalCoordinate | getLocalCoordinate (const MapCoordinate &entryOnMap, const MapCoordinate &field) const |
converts a global coordinate into a local coordinate. More... | |
void | read (tnstream &stream) |
read the binary representation of this item from the given stream More... | |
void | write (tnstream &stream) const |
write the binary representation of this item to the given stream More... | |
void | runTextIO (PropertyContainer &pc) |
registers the properties of this item for loading/writing into asctxt files More... | |
int | getMemoryFootprint () const |
![]() | |
ContainerBaseType () | |
bool | hasFunction (ContainerFunctions function) const |
bool | hasAnyFunction (std::bitset< 64 > functions) const |
ASCString | getName () const |
int | getID () const |
int | getHeight () const |
virtual | ~ContainerBaseType () |
void | runTextIO (PropertyContainer &pc) |
registers the properties of this item for loading/writing into asctxt files More... | |
bool | vehicleFit (const VehicleType *type) const |
can units of the given type be moved into this buildtype? This is a prerequisite - but not the only requirement - for a real unit to move into a real building More... | |
int | vehicleUnloadable (const VehicleType *vehicleType, int carrierHeight) const |
checks the unloading of a unit type More... | |
void | read (tnstream &stream) |
read the binary representation of this item from the given stream More... | |
void | write (tnstream &stream) const |
write the binary representation of this item to the given stream More... | |
Resources | getStorageCapacity (int mode) const |
returns the Storage capacity of the unit More... | |
![]() | |
virtual | ~MapItemType () |
![]() | |
virtual | ~LoadableItemType () |
![]() | |
virtual | ~MemorySizeQueryInterface () |
Public Attributes | |
bool | field_Exists [xdimension][ydimension] |
Surface | w_picture [cwettertypennum][maxbuildingpicnum][4][6] |
int | bi_picture [cwettertypennum][maxbuildingpicnum][4][6] |
BitSet | weatherBits |
DestructionObjects | destructionObjects |
when the building is destroyed, it can leave rubble objects behind. If set to 0 no objects are being created More... | |
LocalCoordinate | entry |
the position of the entrance, which is the field of the building where units can enter and leave More... | |
int | _armor |
the armor of the buildingtype. More... | |
int | technologylevel |
not used at the moment More... | |
TerrainAccess | terrainaccess |
the terrain properties which are necessary for the building to be constructed there More... | |
int | construction_steps |
the number of stages that are required to construct a building using a construction unit. Each stage has a separate picture. Range is 1 to 8 More... | |
int | externalloadheight |
bitmapped: units on these levels of height may be refuelled when standing next to the buildings entry More... | |
bool | buildingNotRemovable |
if true, this building can not be removed by the player with his construction vehicles More... | |
![]() | |
int | id |
vector< int > | secondaryIDs |
when loading a file and these IDs are encountered, this object will be used. More... | |
ASCString | name |
a short name, for example B-52 More... | |
ASCString | description |
short description of the units role, for example "strategic bomber" More... | |
ASCString | infotext |
an extensive information about the unit/building which may be several paragraphs long More... | |
int | jamming |
the radar jamming power More... | |
int | view |
the visibility range More... | |
int | height |
the levels of height which this unit can enter More... | |
Resources | productionCost |
int | maxLoadableUnits |
the maximum number of units that can be loaded More... | |
int | maxLoadableUnitSize |
the maximum size of a unit that may enter the building More... | |
int | maxLoadableWeight |
the maximum total weight of all loaded units More... | |
int | vehicleCategoriesStorable |
bitmapped: vehicle categories that can be stored the container More... | |
int | vehicleCategoriesProduceable |
bitmapped: vehicle categories that can be produced in the container More... | |
vector< IntRange > | vehiclesInternallyProduceable |
the default production capabilities of this container. More... | |
EntranceSystems | entranceSystems |
TechAdapterDependency | techDependency |
ASCString | infoImageFilename |
the filename of an image that is shown in info dialogs More... | |
ASCString | infoImageSmallFilename |
int | efficiencyfuel |
currently only used by mining stations: the efficiency of the resource extraction from the ground. Base is 1024 More... | |
int | efficiencymaterial |
currently only used by mining stations: the efficiency of the resource extraction from the ground. Base is 1024 More... | |
int | maxresearchpoints |
the maximum number of research points a research center may produce More... | |
int | defaultMaxResearchpoints |
when a building of this type is placed on a map, its maxResearch property will be set to this value More... | |
int | nominalresearchpoints |
the number of reseach points for which the plus settings apllies More... | |
int | minFieldRepairDamage |
if the unit is repaired in the field (that is, not inside a transport or building), it can only be repaired up to this level 0 would result in a complete repair being possible, 20 that it can only be restored to 20% damage (80% health). More... | |
Resources | maxplus |
Resources | defaultProduction |
if a new building is constructed, this will be the resource production of the building More... | |
ResourceMatrix | productionEfficiency |
struct { | |
int range | |
int maxFieldsPerTurn | |
vector< IntRange > objectsHarvestable | |
the ids of objects this unit can construct More... | |
vector< IntRange > objectGroupsHarvestable | |
the group-ids of objects this unit can construct More... | |
} | autoHarvest |
![]() | |
ASCString | filename |
The name of the file from which the item was loaded. More... | |
ASCString | location |
The filename and location on disk (including containerfiles) of the object. More... | |
ASCString | archive |
Static Public Attributes | |
static const int | xdimension = 4 |
static const int | ydimension = 6 |
static const int | cbuildingfunctionnum = 24 |
the number of legacy abilities that a building could be equipped with More... | |
![]() | |
static const int | functionNum = 45 |
Additional Inherited Members | |
![]() | |
static const char * | getFunctionName (ContainerFunctions function) |
![]() | |
void | setFunction (ContainerFunctions function) |
![]() | |
std::bitset< 64 > | features |
Resources | asc_mode_tank |
Resources | bi_mode_tank |
The class describing properties that are common to all buildings of a certain kind.
Definition at line 35 of file buildingtype.h.
typedef multimap<LocalCoordinate,int> BuildingType::DestructionObjects |
Definition at line 69 of file buildingtype.h.
BuildingType::BuildingType | ( | void | ) |
Definition at line 68 of file buildingtype.cpp.
References bi_picture, buildingNotRemovable, cwettertypennum, field_Exists, maxbuildingpicnum, and ContainerBaseType::productionEfficiency.
void BuildingType::convertOldFunctions | ( | int | abilities, |
const ASCString & | location | ||
) |
the method for specifying a building's abilility was change at some point in time.
This method converts an old legacy ability specification to the new one
Definition at line 727 of file buildingtype.cpp.
References ContainerBaseType::AmmoProduction, ContainerBaseType::ExternalAmmoTransfer, ContainerBaseType::ExternalFuelTransfer, ContainerBaseType::ExternalMaterialTransfer, ContainerBaseType::features, ContainerBaseType::InternalUnitRepair, ContainerBaseType::InternalVehicleProduction, ContainerBaseType::NoObjectChaining, ContainerBaseType::ProduceNonLeavableUnits, ContainerBaseType::RecycleUnits, ContainerBaseType::SatelliteView, ContainerBaseType::SelfDestructOnConquer, ContainerBaseType::SolarPowerPlant, ContainerBaseType::Sonar, ContainerBaseType::TrainingCenter, warningMessage(), and ContainerBaseType::WindPowerPlant.
Referenced by read(), and runTextIO().
|
inline |
returns whether this building covers the given field
Definition at line 108 of file buildingtype.h.
References field_Exists, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.
Referenced by ConstructBuildingCommand::buildingFits(), Building::chainbuildingtofield(), BuildingTypeBaseWidget::display(), GuiFunctions::generate_gui_build_icon(), BuildingTypeBaseWidget::getBuildingHeight(), Building::getCoveredFields(), Building::getImage(), getLocalCoordinate(), BuildingSeen::getState(), tcomputebuildingview::init(), paint(), ClipBoardBase::place(), BuildingItem::place(), putbuilding(), SpawnBuilding::runAction(), DestructContainer::runAction(), runTextIO(), and Building::unchainbuildingfromfield().
int BuildingType::getBIPicture | ( | const LocalCoordinate & | localCoordinate, |
int | weather = 0 , |
||
int | constructionStep = 0 |
||
) | const |
Definition at line 102 of file buildingtype.cpp.
References bi_picture, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.
MapCoordinate BuildingType::getFieldCoordinate | ( | const MapCoordinate & | entryOnMap, |
const LocalCoordinate & | localCoordinate | ||
) | const |
returns the Mapcoordinate of a buildings field
entryOnMap | The location of the buildings entry on the map |
localCoordinate | The relative coordinate of the buildings segment for which is global MapCoordinate is going to be calculated and returned. |
Definition at line 173 of file buildingtype.cpp.
References entry, BuildingType::LocalCoordinate::x, MapCoordinate::x, BuildingType::LocalCoordinate::y, and MapCoordinate::y.
Referenced by ConstructBuildingCommand::buildingFits(), Reinforcements::execute(), Building::getFieldCoordinates(), ClipBoardBase::place(), BuildingItem::place(), putbuilding(), and SpawnBuilding::runAction().
BuildingType::LocalCoordinate BuildingType::getLocalCoordinate | ( | const MapCoordinate & | entryOnMap, |
const MapCoordinate & | field | ||
) | const |
converts a global coordinate into a local coordinate.
Definition at line 186 of file buildingtype.cpp.
References entry, fieldExists(), BuildingType::LocalCoordinate::x, MapCoordinate::x, BuildingType::LocalCoordinate::y, and MapCoordinate::y.
Referenced by Building::getLocalCoordinate().
|
virtual |
Implements MemorySizeQueryInterface.
Definition at line 89 of file buildingtype.cpp.
References cwettertypennum, maxbuildingpicnum, and w_picture.
|
inlinevirtual |
Implements ContainerBaseType.
Definition at line 91 of file buildingtype.h.
const Surface & BuildingType::getPicture | ( | const LocalCoordinate & | localCoordinate, |
int | weather = 0 , |
||
int | constructionStep = 0 |
||
) | const |
Definition at line 108 of file buildingtype.cpp.
References bi_picture, construction_steps, w_picture, weatherBits, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.
Referenced by Building::getPicture(), and paintSingleField().
void BuildingType::paint | ( | Surface & | s, |
SPoint | pos, | ||
const PlayerColor & | player, | ||
int | weather = 0 , |
||
int | constructionStep = 0 |
||
) | const |
Definition at line 123 of file buildingtype.cpp.
References fieldExists(), and paintSingleField().
Referenced by BuildingItem::display(), and Building::getImage().
Definition at line 132 of file buildingtype.cpp.
References fieldExists(), and paintSingleField().
void BuildingType::paintSingleField | ( | Surface & | s, |
SPoint | pos, | ||
const LocalCoordinate & | localCoordinate, | ||
const PlayerColor & | player, | ||
int | weather = 0 , |
||
int | constructionStep = 0 |
||
) | const |
Definition at line 142 of file buildingtype.cpp.
References fielddisthalfx, fielddistx, fielddisty, getPicture(), megaBlitter(), nullParam, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.
Referenced by BuildingTypeBaseWidget::display(), GuiFunctions::generate_gui_build_icon(), and paint().
void BuildingType::paintSingleField | ( | Surface & | s, |
SPoint | pos, | ||
const LocalCoordinate & | localCoordinate, | ||
int | weather = 0 , |
||
int | constructionStep = 0 |
||
) | const |
Definition at line 157 of file buildingtype.cpp.
References fielddisthalfx, fielddistx, fielddisty, getPicture(), megaBlitter(), nullParam, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.
|
virtual |
read the binary representation of this item from the given stream
Implements LoadableItemType.
Definition at line 211 of file buildingtype.cpp.
References _armor, ContainerBaseType::asc_mode_tank, ContainerBaseType::bi_mode_tank, bi_picture, building_version, buildingNotRemovable, construction_steps, convertOldFunctions(), cwettertypennum, ContainerBaseType::defaultMaxResearchpoints, ContainerBaseType::defaultProduction, ContainerBaseType::description, destructionObjects, ContainerBaseType::efficiencyfuel, ContainerBaseType::efficiencymaterial, Resources::energy, entry, externalloadheight, field_Exists, Resources::fuel, getFirstBit(), tnstream::getLocation(), guardInt, ContainerBaseType::height, ContainerBaseType::infotext, ContainerBaseType::jamming, Resources::material, maxbuildingpicnum, ContainerBaseType::maxplus, ContainerBaseType::maxresearchpoints, ContainerBaseType::name, ContainerBaseType::nominalresearchpoints, ContainerBaseType::productionCost, TerrainAccess::read(), Surface::read(), TechAdapterDependency::read(), ContainerBaseType::read(), tnstream::readInt(), tnstream::readString(), tnstream::readUint8(), ContainerBaseType::techDependency, technologylevel, terrainaccess, ContainerBaseType::view, w_picture, weatherBits, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.
|
virtual |
registers the properties of this item for loading/writing into asctxt files
Implements LoadableItemType.
Definition at line 532 of file buildingtype.cpp.
References _armor, PropertyContainer::addBool(), PropertyContainer::addBreakpoint(), PropertyContainer::addImage(), PropertyContainer::addInteger(), PropertyContainer::addIntegerArray(), PropertyContainer::addString(), PropertyContainer::addTagArray(), PropertyContainer::addTagInteger(), applyFieldMask(), bi_picture, MegaBlitter< BytesPerSourcePixel, BytesPerTargetPixel, SourceColorTransform, ColorMerger, SourcePixelSelector, TargetPixelSelector, MyColorConverter >::blit(), buildingFunctionTags, buildingNotRemovable, cbuildingfunctionnum, choehenstufennum, PropertyContainer::closeBracket(), construction_steps, containerFunctionTags, convertOldFunctions(), Surface::createSurface(), cwettertypennum, destructionObjects, entry, PropertyContainer::error(), externalloadheight, extractFileName_withoutSuffix(), ContainerBaseType::features, field_Exists, fielddisthalfx, fielddistx, fielddisty, fieldExists(), fieldsizex, fieldsizey, LoadableItemType::filename, PropertyContainer::find(), ContainerBaseType::functionNum, PropertyContainer::getFileName(), StringTokenizer::getNextToken(), ContainerBaseType::height, heightTags, PropertyContainer::isReading(), megaBlitter(), ContainerBaseType::name, nullParam, PropertyContainer::openBracket(), ContainerBaseType::productionCost, TerrainAccess::runTextIO(), TechAdapterDependency::runTextIO(), Resources::runTextIO(), ContainerBaseType::runTextIO(), strrr(), ContainerBaseType::techDependency, technologylevel, terrainaccess, BuildingType::LocalCoordinate::toString(), w_picture, weatherAbbrev, weatherBits, weatherTags, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.
Referenced by execaction_pg().
|
virtual |
write the binary representation of this item to the given stream
Implements LoadableItemType.
Definition at line 388 of file buildingtype.cpp.
References _armor, ContainerBaseType::asc_mode_tank, ContainerBaseType::bi_mode_tank, bi_picture, building_version, buildingNotRemovable, construction_steps, cwettertypennum, ContainerBaseType::defaultMaxResearchpoints, ContainerBaseType::defaultProduction, ContainerBaseType::description, destructionObjects, ContainerBaseType::efficiencyfuel, ContainerBaseType::efficiencymaterial, Resources::energy, entry, externalloadheight, Resources::fuel, guardInt, ContainerBaseType::height, ContainerBaseType::infotext, ContainerBaseType::jamming, Resources::material, maxbuildingpicnum, ContainerBaseType::maxplus, ContainerBaseType::maxresearchpoints, ContainerBaseType::name, ContainerBaseType::nominalresearchpoints, ContainerBaseType::productionCost, ContainerBaseType::techDependency, technologylevel, terrainaccess, ContainerBaseType::view, w_picture, TerrainAccess::write(), Surface::write(), TechAdapterDependency::write(), ContainerBaseType::write(), tnstream::writeInt(), tnstream::writeString(), tnstream::writeUint8(), BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.
int BuildingType::_armor |
the armor of the buildingtype.
This does not necessarily be equal to the armor of a specific building during the game, since the map may modify the armor of buildings with a map parameter. Use Building::getArmor() to query the effective armor.
Definition at line 80 of file buildingtype.h.
Referenced by Building::getArmor(), read(), runTextIO(), and write().
int BuildingType::bi_picture[cwettertypennum][maxbuildingpicnum][4][6] |
Definition at line 43 of file buildingtype.h.
Referenced by BuildingType(), getBIPicture(), getPicture(), read(), runTextIO(), and write().
bool BuildingType::buildingNotRemovable |
if true, this building can not be removed by the player with his construction vehicles
Definition at line 126 of file buildingtype.h.
Referenced by BuildingType(), read(), runTextIO(), and write().
|
static |
the number of legacy abilities that a building could be equipped with
Definition at line 54 of file buildingtype.h.
Referenced by runTextIO().
int BuildingType::construction_steps |
the number of stages that are required to construct a building using a construction unit. Each stage has a separate picture. Range is 1 to 8
Definition at line 89 of file buildingtype.h.
Referenced by GuiFunctions::OpenContainer::available(), ConstructBuildingCommand::buildingFits(), getPicture(), tcomputebuildingview::init(), BuildingItem::place(), placeBuilding(), putbuilding(), read(), SpawnBuilding::runAction(), runTextIO(), and write().
DestructionObjects BuildingType::destructionObjects |
when the building is destroyed, it can leave rubble objects behind. If set to 0 no objects are being created
Definition at line 71 of file buildingtype.h.
Referenced by read(), DestructContainer::runAction(), runTextIO(), and write().
LocalCoordinate BuildingType::entry |
the position of the entrance, which is the field of the building where units can enter and leave
Definition at line 74 of file buildingtype.h.
Referenced by Building::chainbuildingtofield(), Building::getEntryField(), getFieldCoordinate(), getLocalCoordinate(), read(), runTextIO(), MapField::setparams(), GetTargetImage::visit(), and write().
int BuildingType::externalloadheight |
bitmapped: units on these levels of height may be refuelled when standing next to the buildings entry
Definition at line 93 of file buildingtype.h.
Referenced by ServiceChecker::check(), read(), runTextIO(), and write().
bool BuildingType::field_Exists[xdimension][ydimension] |
Definition at line 41 of file buildingtype.h.
Referenced by BuildingType(), fieldExists(), read(), and runTextIO().
int BuildingType::technologylevel |
not used at the moment
Definition at line 83 of file buildingtype.h.
Referenced by read(), runTextIO(), and write().
TerrainAccess BuildingType::terrainaccess |
the terrain properties which are necessary for the building to be constructed there
Definition at line 86 of file buildingtype.h.
Referenced by ConstructBuildingCommand::buildingFits(), checkunitsforremoval(), BuildingItem::place(), read(), runTextIO(), and write().
Surface BuildingType::w_picture[cwettertypennum][maxbuildingpicnum][4][6] |
Definition at line 42 of file buildingtype.h.
Referenced by getMemoryFootprint(), getPicture(), read(), runTextIO(), and write().
BitSet BuildingType::weatherBits |
Definition at line 45 of file buildingtype.h.
Referenced by getPicture(), read(), and runTextIO().
|
static |
Definition at line 39 of file buildingtype.h.
Referenced by DestructContainer::runAction().
|
static |
Definition at line 40 of file buildingtype.h.
Referenced by DestructContainer::runAction().