#include <objecttype.h>
Inheritance diagram for ObjectType:

Public Types | |
| enum | NamingMethod { ReplaceTerrain, AddToTerrain, UnNamed } |
| enum | NetBehaviour { NetToBuildings = 1, NetToBuildingEntry = 2, NetToSelf = 4, NetToBorder = 8, SpecialForest = 0x10, AutoBorder = 0x20, KeepOrientation = 0x40 } |
Public Member Functions | |
| const FieldModification & | getFieldModification (int weather) const |
| ASCString | getName () const |
| int | getID () const |
| ObjectType (void) | |
| const OverviewMapImage * | getOverviewMapImage (int picnum, int weather) const |
| void | display (Surface &surface, const SPoint &pos) const |
| displays the objecttype at x/y on the screen | |
| void | display (Surface &surface, const SPoint &pos, int dir, int weather=0) const |
| const Surface & | getPicture (int i=0, int weather=0) const |
| returns the pointer to the image i | |
| bool | buildable (MapField *fld) const |
| can the object be build on the field fld | |
| void | read (tnstream &stream) |
| reads the objecttype from a stream | |
| void | write (tnstream &stream) const |
| write the objecttype from a stream | |
| void | runTextIO (PropertyContainer &pc) |
| reads or writes the objecttype to the text stream pc | |
| int | getEffectiveHeight () const |
| returns the level of height of this object in the normal 8 level scheme of asc (deep submerged, submerged, ... ) | |
| int | getMemoryFootprint () const |
Public Attributes | |
| int | id |
| the id of the object, used when referencing objects in files | |
| vector< int > | secondaryIDs |
| when loading a file and these IDs are encountered, this object will be used. | |
| int | groupID |
| the group ID allows units to specify whole groups of objects to be buildable / removable without specifying each individual object. | |
| BitSet | weather |
| bitmapped variable containing the different weather types the objects exist for | |
| bool | visibleago |
| is the object displayed under fog of war | |
| vector< IntRange > | linkableObjects |
| some objects are graphically linked with others on neighbouring fields. | |
| vector< IntRange > | linkableTerrain |
| objects can be graphically linked to terrain, as if the terrain was an object of the same type. | |
| int | armor |
| if an object should not be attackable, set armor to 0 | |
| ObjectType::FieldModification | fieldModification [cwettertypennum] |
| int | attackbonus_plus |
| this is added to the current attackbonus of the field to form the new attackbonus. | |
| int | attackbonus_abs |
| The attackbonus_abs replaces the current attackbonus of the field by a new one. A value of -1 won't affect the attackbonus of the field. | |
| int | defensebonus_plus |
| this is added to the current defensebonus of the field to form the new defensebonus. | |
| int | defensebonus_abs |
| The defensebonus_abs replaces the current defensebonus of the field by a new one. A value of -1 won't affect the attackbonus of the field. | |
| int | basicjamming_plus |
| this is added to the current basicjamming of the field to form the new jamming. | |
| int | basicjamming_abs |
| basicjamming_abs replaces the current basicjamming of the field by a new one. A value < 0 won't affect the jamming of the field | |
| int | viewbonus_plus |
| units standing on this object will get a bonus to their view | |
| int | viewbonus_abs |
| units standing on this object will get a bonus to their view | |
| int | imageHeight |
| the level of height the object is on. This is not the simple system of 8 levels used for units and building, but one with 255 levels to allow a fine grained specification of the order in which different objects are painted | |
| int | physicalHeight |
| the 'real' height of the object, which evaluated for construction and attack. The destinction between imageHeight and physicalHeight was made because of compatibility reasons | |
| Resources | buildcost |
| The resources required to construct the object with a unit; Note that units usually don't have any energy available. | |
| Resources | removecost |
| The resources required to remove the object with a unit; Note that units usually don't have any energy available. | |
| int | build_movecost |
| The movement points that are needed to build this object. | |
| int | remove_movecost |
| The movement points that are needed to remove this object. | |
| bool | canExistBeneathBuildings |
| if a building is constructed on the field containing the object, will the object be removed or will it stay beneath the building. | |
| ASCString | name |
| The name of the object. | |
| int | namingMethod |
| int | netBehaviour |
| specifies how the object is going to connect to other things | |
| TechAdapterDependency | techDependency |
| ObjectType::WeatherPicture | weatherPicture [cwettertypennum] |
| the images of the objects | |
| int | displayMethod |
| some objects require special displaying methods, for example shading the terrain they are build on | |
| double | growthRate |
| the probability that an object of this type spawns another object on a neighbouring field | |
| bool | growOnUnits |
| is the object growth stopped by units and buildings | |
| int | lifetime |
| the object is removed when it is lifetime turns old. -1 disables removal | |
| int | growthDuration |
| the time after which any growth stops. | |
Static Public Attributes | |
| static const char * | namingMethodNames [] |
| static const int | namingMethodNum |
| static const int | netBehaviourNum = 7 |
Protected Member Functions | |
| int | getWeather (int weather) const |
Classes | |
| struct | FieldModification |
| struct | WeatherPicture |
| the images of the objects More... | |
Definition at line 30 of file objecttype.h.
| NetToBuildings | |
| NetToBuildingEntry | |
| NetToSelf | |
| NetToBorder | |
| SpecialForest | |
| AutoBorder | |
| KeepOrientation |
Definition at line 135 of file objecttype.h.
| ObjectType::ObjectType | ( | void | ) |
Definition at line 47 of file objecttype.cpp.
References AddToTerrain, canExistBeneathBuildings, displayMethod, groupID, growOnUnits, growthDuration, growthRate, imageHeight, lifetime, namingMethod, netBehaviour, physicalHeight, viewbonus_abs, and viewbonus_plus.
| const ObjectType::FieldModification & ObjectType::getFieldModification | ( | int | weather | ) | const |
Definition at line 72 of file objecttype.cpp.
References fieldModification, and getWeather().
Referenced by buildable().
| ASCString ObjectType::getName | ( | ) | const [inline, virtual] |
Implements MapItemType.
Definition at line 124 of file objecttype.h.
References name.
Referenced by SpawnObject::getDescription().
| int ObjectType::getID | ( | ) | const [inline, virtual] |
| const OverviewMapImage * ObjectType::getOverviewMapImage | ( | int | picnum, | |
| int | weather | |||
| ) | const |
Definition at line 111 of file objecttype.cpp.
References getWeather(), ObjectType::WeatherPicture::overviewMapImage, ObjectType::WeatherPicture::resize(), and weatherPicture.
Referenced by Object::getOverviewMapImage().
displays the objecttype at x/y on the screen
Definition at line 289 of file objecttype.cpp.
Referenced by Object::display(), ObjectItem::display(), PipeLayer::paintSingleField(), and GetTargetImage::visit().
| const Surface & ObjectType::getPicture | ( | int | i = 0, |
|
| int | weather = 0 | |||
| ) | const |
returns the pointer to the image i
Definition at line 132 of file objecttype.cpp.
References IconRepository::getIcon(), getWeather(), ObjectType::WeatherPicture::images, s2, and weatherPicture.
Referenced by GuiFunctions::ObjectBuildingGui::getImage().
| bool ObjectType::buildable | ( | MapField * | fld | ) | const |
can the object be build on the field fld
Definition at line 77 of file objecttype.cpp.
References MapField::bdt, MapField::building, getFieldModification(), MapField::getWeather(), and growOnUnits.
Referenced by MapField::addobject().
| void ObjectType::read | ( | tnstream & | stream | ) | [virtual] |
reads the objecttype from a stream
Implements LoadableItemType.
Definition at line 847 of file objecttype.cpp.
References armor, attackbonus_abs, attackbonus_plus, basicjamming_abs, basicjamming_plus, ObjectType::WeatherPicture::bi3pic, build_movecost, buildcost, canExistBeneathBuildings, cwettertypennum, defensebonus_abs, defensebonus_plus, displayMethod, fatalError(), fieldModification, ObjectType::WeatherPicture::flip, tnstream::getLocation(), groupID, growOnUnits, growthDuration, growthRate, imageHeight, ObjectType::WeatherPicture::images, lifetime, linkableObjects, linkableTerrain, ObjectType::FieldModification::movemalus_abs, ObjectType::FieldModification::movemalus_plus, name, namingMethod, netBehaviour, ObjectType::WeatherPicture::originalFilename, physicalHeight, TechAdapterDependency::read(), Surface::read(), Resources::read(), TerrainType::MoveMalus::read(), TerrainBits::read(), readClassContainer(), tnstream::readFloat(), tnstream::readInt(), tnstream::readString(), remove_movecost, removecost, secondaryIDs, techDependency, ObjectType::FieldModification::terrain_and, ObjectType::FieldModification::terrain_or, viewbonus_abs, viewbonus_plus, visibleago, and weatherPicture.
| void ObjectType::write | ( | tnstream & | stream | ) | const [virtual] |
write the objecttype from a stream
Implements LoadableItemType.
Definition at line 996 of file objecttype.cpp.
References armor, attackbonus_abs, attackbonus_plus, basicjamming_abs, basicjamming_plus, build_movecost, buildcost, canExistBeneathBuildings, cwettertypennum, defensebonus_abs, defensebonus_plus, displayMethod, fieldModification, groupID, growOnUnits, growthDuration, growthRate, imageHeight, ObjectType::WeatherPicture::images, lifetime, linkableObjects, linkableTerrain, ObjectType::FieldModification::movemalus_abs, ObjectType::FieldModification::movemalus_plus, name, namingMethod, netBehaviour, physicalHeight, remove_movecost, removecost, secondaryIDs, techDependency, ObjectType::FieldModification::terrain_and, ObjectType::FieldModification::terrain_or, viewbonus_abs, viewbonus_plus, visibleago, weatherPicture, TechAdapterDependency::write(), Resources::write(), TerrainType::MoveMalus::write(), TerrainBits::write(), writeClassContainer(), tnstream::writeFloat(), tnstream::writeInt(), and tnstream::writeString().
| void ObjectType::runTextIO | ( | PropertyContainer & | pc | ) | [virtual] |
reads or writes the objecttype to the text stream pc
Implements LoadableItemType.
Definition at line 1117 of file objecttype.cpp.
References PropertyContainer::addBool(), PropertyContainer::addBreakpoint(), PropertyContainer::addDFloat(), PropertyContainer::addImageArray(), PropertyContainer::addInteger(), PropertyContainer::addIntegerArray(), PropertyContainer::addIntRangeArray(), PropertyContainer::addNamedInteger(), PropertyContainer::addString(), PropertyContainer::addTagArray(), PropertyContainer::addTagInteger(), armor, attackbonus_abs, attackbonus_plus, basicjamming_abs, basicjamming_plus, ObjectType::WeatherPicture::bi3pic, build_movecost, buildcost, canExistBeneathBuildings, PropertyContainer::closeBracket(), cwettertypennum, defensebonus_abs, defensebonus_plus, displayMethod, PropertyContainer::error(), extractFileName_withoutSuffix(), fieldModification, LoadableItemType::filename, PropertyContainer::find(), ObjectType::WeatherPicture::flip, graphicOperationNum, graphicOperations, groupID, growOnUnits, growthDuration, growthRate, imageHeight, ObjectType::WeatherPicture::images, PropertyContainer::isReading(), KeepOrientation, lifetime, linkableObjects, linkableTerrain, name, namingMethod, namingMethodNames, namingMethodNum, netBehaviour, netBehaviourNum, NetToSelf, objectDisplayingMethodNum, objectDisplayingMethodTags, objectNetMethod, PropertyContainer::openBracket(), physicalHeight, remove_movecost, removecost, TechAdapterDependency::runTextIO(), Resources::runTextIO(), ObjectType::FieldModification::runTextIO(), secondaryIDs, snowify(), strrr(), techDependency, ASCString::toString(), viewbonus_abs, viewbonus_plus, visibleago, weatherAbbrev, weatherPicture, and weatherTags.
| int ObjectType::getEffectiveHeight | ( | ) | const |
returns the level of height of this object in the normal 8 level scheme of asc (deep submerged, submerged, ... )
Definition at line 90 of file objecttype.cpp.
References physicalHeight.
| int ObjectType::getMemoryFootprint | ( | ) | const |
Definition at line 832 of file objecttype.cpp.
References cwettertypennum, ObjectType::WeatherPicture::images, ObjectType::WeatherPicture::overviewMapImage, and weatherPicture.
| int ObjectType::getWeather | ( | int | weather | ) | const [protected] |
Definition at line 96 of file objecttype.cpp.
Referenced by display(), getFieldModification(), getOverviewMapImage(), and getPicture().
| int ObjectType::id |
the id of the object, used when referencing objects in files
Definition at line 35 of file objecttype.h.
Referenced by ChangeObjectProperty::ChangeObjectProperty(), getID(), ItemFiltrationSystem::isFiltered(), ActionObjectRemovalStrategy::removeObject(), tunitattacksobject::setresult(), and testObjectRemoval().
when loading a file and these IDs are encountered, this object will be used.
Definition at line 38 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
the group ID allows units to specify whole groups of objects to be buildable / removable without specifying each individual object.
Definition at line 41 of file objecttype.h.
Referenced by ObjectType(), read(), runTextIO(), and write().
bitmapped variable containing the different weather types the objects exist for
Definition at line 44 of file objecttype.h.
Referenced by ForestCalculation::Smoothing::GetNeighbourMask().
is the object displayed under fog of war
Definition at line 47 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
some objects are graphically linked with others on neighbouring fields.
Definition at line 50 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
objects can be graphically linked to terrain, as if the terrain was an object of the same type.
Definition at line 53 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
if an object should not be attackable, set armor to 0
Definition at line 56 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
Referenced by getFieldModification(), PipeLayer::PipeLayer(), read(), runTextIO(), and write().
this is added to the current attackbonus of the field to form the new attackbonus.
Definition at line 79 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
The attackbonus_abs replaces the current attackbonus of the field by a new one. A value of -1 won't affect the attackbonus of the field.
Definition at line 81 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
this is added to the current defensebonus of the field to form the new defensebonus.
Definition at line 84 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
The defensebonus_abs replaces the current defensebonus of the field by a new one. A value of -1 won't affect the attackbonus of the field.
Definition at line 86 of file objecttype.h.
Referenced by read(), runTextIO(), and write().
this is added to the current basicjamming of the field to form the new jamming.
Definition at line 89 of file objecttype.h.
Referenced by trunreplay::execnextreplaymove(), PutObjectCommand::go(), read(), runTextIO(), and write().
basicjamming_abs replaces the current basicjamming of the field by a new one. A value < 0 won't affect the jamming of the field
Definition at line 91 of file objecttype.h.
Referenced by trunreplay::execnextreplaymove(), PutObjectCommand::go(), read(), runTextIO(), and write().
units standing on this object will get a bonus to their view
Definition at line 94 of file objecttype.h.
Referenced by trunreplay::execnextreplaymove(), PutObjectCommand::go(), ObjectType(), read(), runTextIO(), and write().
units standing on this object will get a bonus to their view
Definition at line 96 of file objecttype.h.
Referenced by trunreplay::execnextreplaymove(), PutObjectCommand::go(), ObjectType(), read(), runTextIO(), and write().
the level of height the object is on. This is not the simple system of 8 levels used for units and building, but one with 255 levels to allow a fine grained specification of the order in which different objects are painted
Definition at line 101 of file objecttype.h.
Referenced by compareObjectHeight(), ObjectType(), read(), runTextIO(), and write().
the 'real' height of the object, which evaluated for construction and attack. The destinction between imageHeight and physicalHeight was made because of compatibility reasons
Definition at line 104 of file objecttype.h.
Referenced by getEffectiveHeight(), ObjectType(), read(), runTextIO(), and write().
The resources required to construct the object with a unit; Note that units usually don't have any energy available.
Definition at line 107 of file objecttype.h.
Referenced by trunreplay::execnextreplaymove(), GuiFunctions::ObjectBuildingGui::getName(), PutObjectCommand::go(), read(), runTextIO(), and write().
The resources required to remove the object with a unit; Note that units usually don't have any energy available.
Definition at line 110 of file objecttype.h.
Referenced by trunreplay::execnextreplaymove(), GuiFunctions::ObjectBuildingGui::getName(), PutObjectCommand::go(), read(), runTextIO(), and write().
The movement points that are needed to build this object.
Definition at line 113 of file objecttype.h.
Referenced by trunreplay::execnextreplaymove(), GuiFunctions::ObjectBuildingGui::getName(), PutObjectCommand::go(), read(), runTextIO(), and write().
The movement points that are needed to remove this object.
Definition at line 116 of file objecttype.h.
Referenced by trunreplay::execnextreplaymove(), GuiFunctions::ObjectBuildingGui::getName(), PutObjectCommand::go(), read(), runTextIO(), and write().
if a building is constructed on the field containing the object, will the object be removed or will it stay beneath the building.
Definition at line 119 of file objecttype.h.
Referenced by ObjectType(), read(), runTextIO(), and write().
The name of the object.
Definition at line 122 of file objecttype.h.
Referenced by PutObjectCommand::getDescription(), getName(), GuiFunctions::ObjectBuildingGui::getName(), objectComp(), read(), runTextIO(), and write().
Definition at line 127 of file objecttype.h.
Referenced by ObjectType(), read(), runTextIO(), and write().
const char * ObjectType::namingMethodNames [static] |
const int ObjectType::namingMethodNum [static] |
const int ObjectType::netBehaviourNum = 7 [static] |
specifies how the object is going to connect to other things
Definition at line 138 of file objecttype.h.
Referenced by calculateobject(), ObjectType(), read(), runTextIO(), and write().
the images of the objects
Referenced by getMemoryFootprint(), ForestCalculation::Smoothing::GetNeighbourMask(), getOverviewMapImage(), getPicture(), read(), runTextIO(), and write().
some objects require special displaying methods, for example shading the terrain they are build on
Definition at line 175 of file objecttype.h.
Referenced by ObjectType(), PipeLayer::PipeLayer(), read(), runTextIO(), and write().
| double ObjectType::growthRate |
the probability that an object of this type spawns another object on a neighbouring field
Definition at line 181 of file objecttype.h.
Referenced by ObjectType(), read(), runTextIO(), and write().
is the object growth stopped by units and buildings
Definition at line 184 of file objecttype.h.
Referenced by buildable(), ObjectType(), read(), runTextIO(), and write().
the object is removed when it is lifetime turns old. -1 disables removal
Definition at line 187 of file objecttype.h.
Referenced by MapField::addobject(), Object::Object(), ObjectType(), read(), tspfldloaders::readfields(), runTextIO(), and write().
the time after which any growth stops.
This parameter is passed to all child-objects spawned through growth and should therefor be bigger than lifetime. Use -1 for unlimited
Definition at line 191 of file objecttype.h.
Referenced by Object::Object(), ObjectType(), read(), runTextIO(), and write().
1.5.1