Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

BuildingType Class Reference

The class describing properties that are common to all buildings of a certain kind. More...

#include <buildingtype.h>

Inheritance diagram for BuildingType:

Inheritance graph
[legend]
List of all members.

Public Types

typedef multimap< LocalCoordinate,
int > 
DestructionObjects

Public Member Functions

int getMoveMalusType () const
const SurfacegetPicture (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
 BuildingType (void)
MapCoordinate getFieldCoordinate (const MapCoordinate &entryOnMap, const LocalCoordinate &localCoordinate) const
 returns the Mapcoordinate of a buildings field
LocalCoordinate getLocalCoordinate (const MapCoordinate &entryOnMap, const MapCoordinate &field) const
 converts a global coordinate into a local coordinate.
void read (tnstream &stream)
void write (tnstream &stream) const
void runTextIO (PropertyContainer &pc)
int getMemoryFootprint () const

Public Attributes

DestructionObjects destructionObjects
 when the building is destroyed, it can leave rubble objects behind. If set to 0 no objects are being created
LocalCoordinate entry
int _armor
 the armor of the buildingtype.
int technologylevel
 not used at the moment
int researchid
 not used at the moment
TerrainAccess terrainaccess
 the terrain properties which are necessary for the building to be constructed there
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
int buildingheight
 bitmapped: the level of height that this building will reside on.
int externalloadheight
 bitmapped: units on these levels of height may be refuelled when standing next to the buildings entry
bool buildingNotRemovable

Classes

class  LocalCoordinate
 A local coordinate referencing a single field that a building covers. More...

Detailed Description

The class describing properties that are common to all buildings of a certain kind.

See also:
Building

Definition at line 80 of file buildingtype.h.


Member Typedef Documentation

typedef multimap<LocalCoordinate,int> BuildingType::DestructionObjects
 

Definition at line 105 of file buildingtype.h.


Constructor & Destructor Documentation

BuildingType::BuildingType void   ) 
 

Definition at line 68 of file buildingtype.cpp.

References buildingNotRemovable, cwettertypennum, maxbuildingpicnum, and ContainerBaseType::productionEfficiency.


Member Function Documentation

bool BuildingType::fieldExists const LocalCoordinate localCoordinate  )  const [inline]
 

Definition at line 149 of file buildingtype.h.

References BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.

Referenced by Building::chainbuildingtofield(), BuildingTypeBaseWidget::display(), GuiFunctions::BuildingConstruction::execute(), GuiFunctions::generate_gui_build_icon(), BuildingTypeBaseWidget::getBuildingHeight(), Building::getCoveredFields(), Building::getImage(), getLocalCoordinate(), BuildingSeen::getState(), tcomputebuildingview::init(), paint(), BuildingItem::place(), ClipBoardBase::place(), putbuilding(), putbuilding2(), and Building::unchainbuildingfromfield().

int BuildingType::getBIPicture const LocalCoordinate localCoordinate,
int  weather = 0,
int  constructionStep = 0
const
 

Definition at line 102 of file buildingtype.cpp.

MapCoordinate BuildingType::getFieldCoordinate const MapCoordinate entryOnMap,
const LocalCoordinate localCoordinate
const
 

returns the Mapcoordinate of a buildings field

Parameters:
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, MapCoordinate::y, and BuildingType::LocalCoordinate::y.

Referenced by GuiFunctions::BuildingConstruction::execute(), Reinforcements::execute(), Building::getFieldCoordinates(), BuildingItem::place(), ClipBoardBase::place(), putbuilding(), and putbuilding2().

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().

int BuildingType::getMemoryFootprint  )  const [virtual]
 

Implements MemorySizeQueryInterface.

Definition at line 89 of file buildingtype.cpp.

References cwettertypennum, Surface::getMemoryFootprint(), and maxbuildingpicnum.

int BuildingType::getMoveMalusType  )  const [inline, virtual]
 

Implements ContainerBaseType.

Definition at line 132 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 construction_steps, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.

Referenced by Building::getPicture(), and paintSingleField().

void BuildingType::paint Surface s,
SPoint  pos
const
 

Definition at line 132 of file buildingtype.cpp.

References fieldExists(), 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().

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.

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::read tnstream stream  )  [virtual]
 

Reimplemented from ContainerBaseType.

Definition at line 211 of file buildingtype.cpp.

References _armor, ContainerBaseType::asc_mode_tank, ContainerBaseType::bi_mode_tank, building_version, buildingheight, buildingNotRemovable, construction_steps, cwettertypennum, ContainerBaseType::defaultMaxResearchpoints, ContainerBaseType::defaultProduction, destructionObjects, ContainerBaseType::efficiencyfuel, ContainerBaseType::efficiencymaterial, Resources::energy, entry, externalloadheight, Resources::fuel, tnstream::getLocation(), ContainerBaseType::infotext, ContainerBaseType::jamming, log2(), Resources::material, maxbuildingpicnum, ContainerBaseType::maxplus, ContainerBaseType::maxresearchpoints, ContainerBaseType::name, ContainerBaseType::nominalresearchpoints, ContainerBaseType::productionCost, TechAdapterDependency::read(), ContainerBaseType::read(), Surface::read(), TerrainAccess::read(), tnstream::readChar(), tnstream::readInt(), tnstream::readString(), researchid, ContainerBaseType::techDependency, technologylevel, terrainaccess, ContainerBaseType::view, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.

void BuildingType::runTextIO PropertyContainer pc  )  [virtual]
 

Reimplemented from ContainerBaseType.

Definition at line 504 of file buildingtype.cpp.

References _armor, PropertyContainer::addBool(), PropertyContainer::addBreakpoint(), PropertyContainer::addImage(), PropertyContainer::addInteger(), PropertyContainer::addIntegerArray(), PropertyContainer::addString(), PropertyContainer::addTagArray(), PropertyContainer::addTagInteger(), applyFieldMask(), MegaBlitter< BytesPerSourcePixel, BytesPerTargetPixel, SourceColorTransform, ColorMerger, SourcePixelSelector, TargetPixelSelector, MyColorConverter >::blit(), buildingFunctionTags, buildingheight, buildingNotRemovable, choehenstufennum, PropertyContainer::closeBracket(), construction_steps, containerFunctionTags, Surface::createSurface(), cwettertypennum, destructionObjects, entry, PropertyContainer::error(), externalloadheight, extractFileName_withoutSuffix(), ContainerBaseType::features, fielddisthalfx, fielddistx, fielddisty, fieldsizex, fieldsizey, LoadableItemType::filename, PropertyContainer::find(), ContainerBaseType::functionNum, PropertyContainer::getFileName(), StringTokenizer::getNextToken(), heightTags, PropertyContainer::isReading(), megaBlitter(), nullParam, PropertyContainer::openBracket(), ContainerBaseType::productionCost, TechAdapterDependency::runTextIO(), Resources::runTextIO(), TerrainAccess::runTextIO(), ContainerBaseType::runTextIO(), strrr(), ContainerBaseType::techDependency, technologylevel, terrainaccess, BuildingType::LocalCoordinate::toString(), weatherAbbrev, weatherTags, BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.

Referenced by execaction_pg().

void BuildingType::write tnstream stream  )  const [virtual]
 

Reimplemented from ContainerBaseType.

Definition at line 372 of file buildingtype.cpp.

References _armor, ContainerBaseType::asc_mode_tank, ContainerBaseType::bi_mode_tank, building_version, buildingheight, buildingNotRemovable, construction_steps, cwettertypennum, ContainerBaseType::defaultMaxResearchpoints, ContainerBaseType::defaultProduction, destructionObjects, ContainerBaseType::efficiencyfuel, ContainerBaseType::efficiencymaterial, Resources::energy, entry, externalloadheight, Resources::fuel, ContainerBaseType::infotext, ContainerBaseType::jamming, Resources::material, maxbuildingpicnum, ContainerBaseType::maxplus, ContainerBaseType::maxresearchpoints, ContainerBaseType::name, ContainerBaseType::nominalresearchpoints, ContainerBaseType::productionCost, researchid, ContainerBaseType::techDependency, technologylevel, terrainaccess, ContainerBaseType::view, TechAdapterDependency::write(), ContainerBaseType::write(), Surface::write(), TerrainAccess::write(), BuildingType::LocalCoordinate::x, and BuildingType::LocalCoordinate::y.


Member Data Documentation

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 115 of file buildingtype.h.

Referenced by Building::getArmor(), read(), runTextIO(), and write().

int BuildingType::buildingheight
 

bitmapped: the level of height that this building will reside on.

Definition at line 130 of file buildingtype.h.

Referenced by attackpossible(), calcvisibilityfield(), Building::getEntry(), Building::getHeight(), BuildingSeen::getState(), tcomputebuildingview::init(), MapRenderer::paintSingleField(), read(), runTextIO(), tunitattacksbuilding::setup(), tsearchdestructbuildingfields::testfield(), and write().

bool BuildingType::buildingNotRemovable
 

Definition at line 166 of file buildingtype.h.

Referenced by BuildingType(), read(), runTextIO(), tsearchdestructbuildingfields::testfield(), and write().

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 127 of file buildingtype.h.

Referenced by getPicture(), tcomputebuildingview::init(), BuildingItem::place(), putbuilding(), putbuilding2(), read(), 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 107 of file buildingtype.h.

Referenced by read(), runTextIO(), Building::unchainbuildingfromfield(), and write().

LocalCoordinate BuildingType::entry
 

Definition at line 109 of file buildingtype.h.

Referenced by Building::chainbuildingtofield(), GuiFunctions::BuildingConstruction::execute(), Building::getEntryField(), getFieldCoordinate(), getLocalCoordinate(), read(), runTextIO(), tfield::setparams(), 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 134 of file buildingtype.h.

Referenced by VehicleService::FieldSearch::checkBuilding2Vehicle(), read(), runTextIO(), and write().

int BuildingType::researchid
 

not used at the moment

Definition at line 121 of file buildingtype.h.

Referenced by read(), and write().

int BuildingType::technologylevel
 

not used at the moment

Definition at line 118 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 124 of file buildingtype.h.

Referenced by BuildingItem::place(), read(), runTextIO(), and write().


The documentation for this class was generated from the following files:
Generated on Tue May 13 01:53:59 2008 for Advanced Strategic Command by  doxygen 1.4.2