#include <mapfield.h>
Public Types | |
| typedef list< Mine > | MineContainer |
| typedef vector< ::Object > | ObjectContainer |
Public Member Functions | |
| tfield (GameMap *gamemap_) | |
| void | operator= (const tfield &f) |
| void | setMap (GameMap *gamemap_) |
| Mine & | getMine (int n) |
| returns the nth mine. This function should only be used by legacy code; new code should store an iterator instead of an index | |
| bool | addobject (const ObjectType *obj, int dir=-1, bool force=false) |
| add an object to the field | |
| void | removeobject (const ObjectType *obj, bool force=false) |
| removes all objects of the given type from the field | |
| void | sortobjects (void) |
| sorts the objects. Since objects can be on different levels of height, the lower one must be displayed first | |
| Object * | checkforobject (const ObjectType *o) |
| checks if there are objects from the given type on the field and returns them | |
| void | deleteeverything (void) |
| deletes everything placed on the field | |
| void | setparams (void) |
| recalculates the terrain properties, movemalus etc from the terraintype and the objects, | |
| int | getdefensebonus (void) |
| the defense bonus that unit get when they are attacked | |
| int | getattackbonus (void) |
| the attack bonus that unit get when they are attacking | |
| int | getweather (void) |
| the weather that is on this field | |
| void | setweather (int weather) |
| ASCString | getName () |
| int | getjamming (void) |
| the radar jamming that is on this field | |
| int | getmovemalus (const Vehicle *veh) |
| int | getmovemalus (int type) |
| int | mineattacks (const Vehicle *veh) |
| can any of the mines on this field attack this unit | |
| int | mineowner (void) |
| the player who placed the mines on this field. | |
| bool | unitHere (const Vehicle *veh) |
| checks if the unit is standing on this field. Since units are being cloned for some checks, this method should be used instead of comparing the pointers to the unit | |
| ContainerBase * | getContainer () |
| returns a pointer to the ContainerBase of the field or NULL if there is none | |
| bool | putmine (int col, int typ, int strength) |
| put a mine of type typ for player col (0..7) and a punch of strength on the field. Strength is an absolute value (unlike the basestrength of a mine or the punch of the mine-weapon, which are just factors) | |
| void | removemine (int num) |
| removes a mine | |
| void | endRound (int turn) |
| void | setVisibility (VisibilityStates valtoset, int actplayer) |
| The visibility status for all players is stored in a bitmapped variable. | |
| VisibilityStates | getVisibility (int actplayer) |
| int | getx () |
| int | gety () |
| int | getMemoryFootprint () const |
| ~tfield () | |
Static Public Member Functions | |
| static void | resetView (GameMap *gamemap, int playersToReset) |
Public Attributes | |
| TerrainType::Weather * | typ |
| the terraintype of the field | |
| char | fuel |
| mineral resources on this field (should be changed to Resources sometime...) | |
| char | material |
| mineral resources on this field (should be changed to Resources sometime...) | |
| Uint16 | visible |
| can this field be seen be the player. Variable is bitmapped; two bits for each player. These two bits can have the states defined in VisibilityStates | |
| int | viewbonus |
| units standing on this object will get a bonus to their view | |
| int | temp3 |
| int | temp4 |
| Vehicle * | vehicle |
| Building * | building |
| Resourceview * | resourceview |
| the mineral resources that were seen by a player on this field; since the actual amount may have decreased since the player looked, this value is not identical to the fuel and material fields. | |
| MineContainer | mines |
| ObjectContainer | objects |
| TerrainBits | bdt |
| the terraintype properties. They determine which units can move over the field. This variable is recalculated from the terraintype and objects each time something on the field changes (setparams) | |
| int | connection |
| are any events connected to this field | |
| tfield::View | view [8] |
| some variables for the viewcalculation algorithm. see viewcalculation.cpp for details | |
| char | temp |
| char | temp2 |
| struct { | |
| char temp | |
| char temp2 | |
| } | a |
| Uint16 | tempw |
Protected Member Functions | |
| tfield () | |
Friends | |
| class | GameMap |
Classes | |
| struct | Resourceview |
| struct | View |
| some variables for the viewcalculation algorithm. see viewcalculation.cpp for details More... | |
Definition at line 25 of file mapfield.h.
|
|
Definition at line 78 of file mapfield.h. |
|
|
Definition at line 85 of file mapfield.h. |
|
|
Definition at line 40 of file mapfield.cpp. |
|
|
Definition at line 34 of file mapfield.cpp. References setMap(). |
|
|
Definition at line 528 of file mapfield.cpp. References resourceview. |
|
||||||||||||||||
|
add an object to the field
Definition at line 149 of file mapfield.cpp. References calculateobject(), checkforobject(), Object::dir, getx(), gety(), AgeableItem::lifetimer, objects, setparams(), and sortobjects(). Referenced by copyFieldStep2(), trunreplay::execnextreplaymove(), Vehicle::spawnMoveObjects(), transformMap(), and Building::unchainbuildingfromfield(). |
|
|
checks if there are objects from the given type on the field and returns them
Definition at line 503 of file mapfield.cpp. References objects. Referenced by addobject(), GuiFunctions::ObjectBuildingGui::checkObject(), GuiFunctions::ObjectBuildingGui::execute(), ForestCalculation::Smoothing::GetNeighbourMask(), and PipeLayer::paintSingleField(). |
|
|
deletes everything placed on the field
Definition at line 219 of file mapfield.cpp. References building, setparams(), and vehicle. Referenced by copyFieldStep1(). |
|
|
Definition at line 79 of file mapfield.cpp. References AgeableItem::age(), mines, objects, and setparams(). |
|
|
the attack bonus that unit get when they are attacking
Definition at line 372 of file mapfield.cpp. References a, TerrainType::Weather::attackbonus, objects, and typ. Referenced by DashboardPanel::eval(), tunitattacksobject::setup(), tunitattacksbuilding::setup(), tunitattacksunit::setup(), and viewterraininfo(). |
|
|
returns a pointer to the ContainerBase of the field or NULL if there is none
Definition at line 245 of file mapfield.cpp. References building, and vehicle. Referenced by GuiFunctions::SelfDestructIcon::available(), GuiFunctions::RefuelUnitDialog::available(), GuiFunctions::RefuelUnit::available(), Vehicle::canMove(), GuiIconHandler::checkForKey(), trunreplay::execnextreplaymove(), GuiFunctions::SelfDestructIcon::execute(), GuiFunctions::RefuelUnit::execute(), GuiFunctions::OpenContainer::execute(), AStar3D::findPath(), GameMap::getUnit(), BaseVehicleMovement::moveunitxy(), ContainerInfoLayer::paintSingleField(), and tgiveunitawaydlg::run(). |
|
|
the defense bonus that unit get when they are attacked
Definition at line 388 of file mapfield.cpp. References a, TerrainType::Weather::defensebonus, objects, and typ. Referenced by DashboardPanel::eval(), tunitattacksobject::setup(), tunitattacksbuilding::setup(), tunitattacksunit::setup(), and viewterraininfo(). |
|
|
the radar jamming that is on this field
Definition at line 419 of file mapfield.cpp. References a, TerrainType::Weather::basicjamming, objects, and typ. Referenced by DashboardPanel::eval(), VisibilityLayer::paintSingleField(), and viewterraininfo(). |
|
|
Definition at line 521 of file mapfield.cpp. Referenced by MemoryMeasurement::measure(). |
|
|
returns the nth mine. This function should only be used by legacy code; new code should store an iterator instead of an index
Definition at line 141 of file mapfield.cpp. References mines. Referenced by tmineattacksunit::setup(). |
|
|
Definition at line 455 of file mapfield.cpp. |
|
|
Definition at line 434 of file mapfield.cpp. References ContainerBase::color, fatalError(), getx(), gety(), TerrainType::id, mine_movemalus_increase, mineowner(), mines, minmalq, Vehicletype::movemalustyp, TerrainType::Weather::terraintype, typ, and Vehicle::typ. Referenced by calcMoveMalus(), AStar::getDistance(), and viewterraininfo(). |
|
|
Definition at line 404 of file mapfield.cpp. References a, ObjectType::AddToTerrain, TerrainType::name, objects, ObjectType::ReplaceTerrain, TerrainType::Weather::terraintype, and typ. |
|
|
Definition at line 171 of file mapfield.h. References visible. Referenced by Player::swap(), and testDebugFunction(). |
|
|
the weather that is on this field
Definition at line 254 of file mapfield.cpp. References cwettertypennum, TerrainType::Weather::terraintype, typ, and TerrainType::weather. Referenced by ObjectType::buildable(), GuiFunctions::ObjectBuildingGui::checkObject(), checkobjectsforremoval(), Building::getPicture(), MapRenderer::paintSingleField(), setparams(), tunitattacksobject::setup(), transformMap(), and viewterraininfo(). |
|
|
Definition at line 359 of file mapfield.cpp. References GameMap::field, and GameMap::xsize. Referenced by addobject(), copyFieldStep2(), getmovemalus(), CopyMap::paste(), removeobject(), and setparams(). |
|
|
Definition at line 365 of file mapfield.cpp. References GameMap::field, and GameMap::xsize. Referenced by addobject(), copyFieldStep2(), getmovemalus(), CopyMap::paste(), removeobject(), and setparams(). |
|
|
can any of the mines on this field attack this unit
Definition at line 131 of file mapfield.cpp. References mines. Referenced by BaseVehicleMovement::moveunitxy(). |
|
|
the player who placed the mines on this field.
Definition at line 336 of file mapfield.cpp. References mines. Referenced by tplayerchange::anzeige(), GuiFunctions::PutAntiSubMine::available(), GuiFunctions::PutAntiShipMine::available(), GuiFunctions::PutGroundMine::available(), calcvisibilityfield(), getmovemalus(), putmine(), and tputmine::testfield(). |
|
|
Definition at line 105 of file mapfield.cpp. References bdt, building, connection, fuel, material, mines, objects, resourceview, temp3, temp4, tempw, typ, vehicle, view, and visible. |
|
||||||||||||||||
|
put a mine of type typ for player col (0..7) and a punch of strength on the field. Strength is an absolute value (unlike the basestrength of a mine or the punch of the mine-weapon, which are just factors)
Definition at line 322 of file mapfield.cpp. References cgp_maxminesonfield, GameMap::getgameparameter(), mineowner(), and mines. Referenced by copyFieldStep2(). |
|
|
removes a mine
Definition at line 345 of file mapfield.cpp. References mines. Referenced by execaction(), putMine(), and tmineattacksunit::setresult(). |
|
||||||||||||
|
removes all objects of the given type from the field
Definition at line 190 of file mapfield.cpp. References GameMap::actplayer, building, calculateobject(), getx(), gety(), objects, setparams(), and vehicle. Referenced by checkobjectsforremoval(), copyFieldStep1(), execaction(), trunreplay::execnextreplaymove(), GuiFunctions::ObjectBuildingGui::execute(), and transformMap(). |
|
||||||||||||
|
Definition at line 294 of file mapfield.cpp. References GameMap::field, and visible. Referenced by GameMap::endRound(). |
|
|
Definition at line 35 of file mapfield.h. Referenced by GameMap::allocateFields(), generatemap(), GameMap::resize(), and tfield(). |
|
|
recalculates the terrain properties, movemalus etc from the terraintype and the objects,
Definition at line 460 of file mapfield.cpp. References TerrainType::Weather::art, bdt, building, cbbuildingentry, cgp_objectsDestroyedByTerrain, cmovemalitypenum, BuildingType::entry, fatalError(), Building::getField(), GameMap::getgameparameter(), getTerrainBitType(), getweather(), getx(), gety(), TerrainType::id, minmalq, TerrainType::Weather::move_malus, objects, TerrainType::Weather::terraintype, Building::typ, typ, and viewbonus. Referenced by addobject(), GameMap::allocateFields(), calculateallobjects(), ForestCalculation::calculateforest(), calculateobject(), tspfldloaders::chainitems(), deleteeverything(), endRound(), generatemap(), TerrainItem::place(), removeobject(), WeatherField::reset(), GameMap::resize(), tmapgenerator::setmap(), setweather(), transformMap(), and WeatherField::update(). |
|
||||||||||||
|
The visibility status for all players is stored in a bitmapped variable. This functions changes the status in this variable for a single player
Definition at line 285 of file mapfield.cpp. References visible. Referenced by evaluatevisibilityfield(), Player::resetView(), and Player::swap(). |
|
|
Definition at line 264 of file mapfield.cpp. References setparams(), TerrainType::Weather::terraintype, typ, and TerrainType::weather. Referenced by copyFieldStep1(), TerrainItem::place(), WeatherField::reset(), and WeatherField::update(). |
|
|
sorts the objects. Since objects can be on different levels of height, the lower one must be displayed first
Definition at line 317 of file mapfield.cpp. References compareObjectHeight(), and objects. Referenced by addobject(), tspfldloaders::readfields(), and transformMap(). |
|
|
checks if the unit is standing on this field. Since units are being cloned for some checks, this method should be used instead of comparing the pointers to the unit
Definition at line 235 of file mapfield.cpp. References Vehicle::networkid, and vehicle. Referenced by Vehicle::canMove(), ChangeVehicleHeight::execute(), VehicleMovement::execute(), and BaseVehicleMovement::PathFinder::getMovementFields(). |
|
|
Definition at line 30 of file mapfield.h. |
|
|
|
the terraintype properties. They determine which units can move over the field. This variable is recalculated from the terraintype and objects each time something on the field changes (setparams)
Definition at line 107 of file mapfield.h. Referenced by GuiFunctions::PutAntiShipMine::available(), GuiFunctions::PutGroundMine::available(), ObjectType::buildable(), Building::chainbuildingtofield(), GuiFunctions::ObjectBuildingGui::checkObject(), checkobjectsforremoval(), checkunitsforremoval(), copyFieldStep1(), DashboardPanel::eval(), JumpDrive::fieldReachable(), AStar3D::findPath(), getmaxwindspeedforunit(), operator=(), PipeLayer::paintSingleField(), ContainerInfoLayer::paintSingleField(), VehicleItem::place(), tspfldloaders::readfields(), UnitTypeTransformation::run(), GuiFunctions::BuildingConstruction::search(), setparams(), showbdtbits(), stu_height(), terrainaccessible2(), transformMap(), Building::unchainbuildingfromfield(), viewterraininfo(), and tspfldloaders::writefields(). |
|
|
|
are any events connected to this field
Definition at line 110 of file mapfield.h. Referenced by AnyUnitEntersPolygon::fieldOperator(), SpecificUnitEntersPolygon::fieldOperator(), BaseVehicleMovement::moveunitxy(), operator=(), tspfldloaders::readfields(), and tspfldloaders::writefields(). |
|
|
mineral resources on this field (should be changed to Resources sometime...)
Definition at line 41 of file mapfield.h. Referenced by tres::buttonpressed(), copyFieldStep1(), tres::init(), operator=(), ResourceGraphLayer::paintSingleField(), tspfldloaders::readfields(), tmapgenerator::setfuel(), tsearchforminablefields::testfield(), tputresources::testfield(), MiningStation::testfield(), GetMiningInfo::testfield(), and tspfldloaders::writefields(). |
|
|
mineral resources on this field (should be changed to Resources sometime...)
Definition at line 41 of file mapfield.h. Referenced by tres::buttonpressed(), copyFieldStep1(), tres::init(), operator=(), ResourceGraphLayer::paintSingleField(), tspfldloaders::readfields(), tmapgenerator::setmaterial(), tsearchforminablefields::testfield(), tputresources::testfield(), MiningStation::testfield(), GetMiningInfo::testfield(), and tspfldloaders::writefields(). |
|
|
|
|
the mineral resources that were seen by a player on this field; since the actual amount may have decreased since the player looked, this value is not identical to the fuel and material fields.
Definition at line 76 of file mapfield.h. Referenced by operator=(), ResourceGraphLayer::paintSingleField(), tspfldloaders::readfields(), Player::resetView(), Player::swap(), tsearchforminablefields::testfield(), MiningStation::testfield(), tspfldloaders::writefields(), and ~tfield(). |
|
|
Definition at line 54 of file mapfield.h. |
|
|
Definition at line 55 of file mapfield.h. |
|
|
Definition at line 59 of file mapfield.h. Referenced by GameMap::cleartemps(), AStar::findPath(), and operator=(). |
|
|
Definition at line 60 of file mapfield.h. Referenced by GameMap::cleartemps(), and operator=(). |
|
|
Definition at line 57 of file mapfield.h. Referenced by operator=(), and tspfldloaders::readfields(). |
|
|
|
|
some variables for the viewcalculation algorithm. see viewcalculation.cpp for details
Referenced by calcvisibilityfield(), clearvisibility(), tcomputebuildingview::init(), operator=(), VisibilityLayer::paintSingleField(), tspfldloaders::readfields(), tcomputeview::testfield(), and viewterraininfo(). |
|
|
units standing on this object will get a bonus to their view
Definition at line 47 of file mapfield.h. Referenced by tcomputebuildingview::init(), tcomputevehicleview::init(), and setparams(). |
|
|
can this field be seen be the player. Variable is bitmapped; two bits for each player. These two bits can have the states defined in VisibilityStates
Definition at line 44 of file mapfield.h. Referenced by calcvisibilityfield(), evaluatevisibilityfield(), fieldVisibility(), getVisibility(), operator=(), tspfldloaders::readfields(), resetView(), setVisibility(), and tspfldloaders::writefields(). |
1.4.2