#include <MovementMap.h>
Public Types | |
| enum | MovementMapEntryType { eNotInitialized = 0, eNotSeen = 1, eNoMovement = 2, eMovement = 3 } |
Public Member Functions | |
| MovementMap (Tank *tank, ScorchedContext &context) | |
| virtual | ~MovementMap () |
| bool | calculatePosition (FixedVector &position, fixed fuel) |
| void | calculateAllPositions (fixed fuel) |
| MovementMapEntry & | getEntry (int w, int h) |
| void | movementTexture () |
| fixed | getFuel (WeaponMoveTank *weapon) |
Static Public Member Functions | |
| static void | limitTexture (FixedVector ¢er, int limit) |
| static bool | inShield (Target *target, Tank *tank, FixedVector &position) |
| static bool | movementProof (ScorchedContext &context, Target *target, Tank *tank) |
| static bool | allowedPosition (ScorchedContext &context, Tank *tank, FixedVector &position) |
Protected Member Functions | |
| unsigned int | POINT_TO_UINT (unsigned int x, unsigned int y) |
| void | addPoint (unsigned int x, unsigned int y, fixed height, fixed dist, std::list< unsigned int > &edgeList, unsigned int sourcePt, unsigned int epoc) |
| void | addPoint (unsigned int x, unsigned int y, fixed height, fixed dist, std::priority_queue< QueuePosition, std::vector< QueuePosition >, std::less< QueuePosition > > &priorityQueue, unsigned int sourcePt, FixedVector &position) |
| fixed | getWaterHeight () |
| bool | tankBurried () |
| MovementMapEntry & | getAndCheckEntry (int w, int h) |
Protected Attributes | |
| MovementMapEntry * | entries_ |
| int | landscapeWidth_ |
| int | landscapeHeight_ |
| int | arenaX_ |
| int | arenaY_ |
| int | arenaWidth_ |
| int | arenaHeight_ |
| fixed | minHeight_ |
| Tank * | tank_ |
| ScorchedContext & | context_ |
| std::list< Target * > | checkTargets_ |
Classes | |
| struct | MovementMapEntry |
| struct | QueuePosition |
Definition at line 32 of file MovementMap.h.
Definition at line 35 of file MovementMap.h.
| MovementMap::MovementMap | ( | Tank * | tank, | |
| ScorchedContext & | context | |||
| ) |
Definition at line 42 of file MovementMap.cpp.
References arenaHeight_, arenaWidth_, arenaX_, arenaY_, checkTargets_, context_, eNotInitialized, entries_, GroundMaps::getArenaHeight(), GroundMaps::getArenaWidth(), GroundMaps::getArenaX(), GroundMaps::getArenaY(), LandscapeMaps::getGroundMaps(), GroundMaps::getLandscapeHeight(), ScorchedContext::getLandscapeMaps(), GroundMaps::getLandscapeWidth(), ScorchedContext::getTargetContainer(), TargetContainer::getTargets(), getWaterHeight(), landscapeHeight_, landscapeWidth_, minHeight_, and movementProof().
| MovementMap::~MovementMap | ( | ) | [virtual] |
| bool MovementMap::calculatePosition | ( | FixedVector & | position, | |
| fixed | fuel | |||
| ) |
Definition at line 425 of file MovementMap.cpp.
References addPoint(), calcDistance(), context_, MovementMap::MovementMapEntry::dist, MovementMap::QueuePosition::distance, eMovement, eNotSeen, getAndCheckEntry(), getEntry(), LandscapeMaps::getGroundMaps(), GroundMaps::getHeight(), ScorchedContext::getLandscapeMaps(), Tank::getPosition(), TankPosition::getTankPosition(), int(), POINT_TO_UINT(), MovementMap::QueuePosition::square, tank_, and tankBurried().
Referenced by TankMovement::init(), TankAICurrentMove::makeMoveShot(), TargetCamera::mouseUp(), and ServerShotHolder::validateFiredMessage().
| void MovementMap::calculateAllPositions | ( | fixed | fuel | ) |
Definition at line 496 of file MovementMap.cpp.
References addPoint(), context_, MovementMap::MovementMapEntry::dist, eMovement, eNotSeen, getAndCheckEntry(), getEntry(), LandscapeMaps::getGroundMaps(), GroundMaps::getHeight(), ScorchedContext::getLandscapeMaps(), Tank::getPosition(), TankPosition::getTankPosition(), int(), POINT_TO_UINT(), tank_, and tankBurried().
Referenced by TankWeapon::setCurrentWeapon().
| MovementMap::MovementMapEntry & MovementMap::getEntry | ( | int | w, | |
| int | h | |||
| ) |
Definition at line 89 of file MovementMap.cpp.
References arenaHeight_, arenaWidth_, arenaX_, arenaY_, eNoMovement, entries_, landscapeWidth_, and MovementMap::MovementMapEntry::type.
Referenced by calculateAllPositions(), calculatePosition(), getAndCheckEntry(), TankMovement::init(), TankAICurrentMove::makeMoveShot(), TargetCamera::mouseUp(), movementTexture(), and ServerShotHolder::validateFiredMessage().
| void MovementMap::movementTexture | ( | ) |
Definition at line 567 of file MovementMap.cpp.
References ImageFactory::createBlank(), eMovement, Landscape::eOther, ImageHandle::getBits(), Image::getBits(), getEntry(), LandscapeMaps::getGroundMaps(), ImageHandle::getHeight(), getHeight(), GroundMaps::getLandscapeHeight(), ScorchedContext::getLandscapeMaps(), GroundMaps::getLandscapeWidth(), Landscape::getMainMap(), Landscape::getMainTexture(), ImageHandle::getWidth(), ScorchedClient::instance(), Landscape::instance(), int(), GLTexture::replace(), Landscape::setTextureType(), and MovementMap::MovementMapEntry::type.
Referenced by TankWeapon::setCurrentWeapon().
| void MovementMap::limitTexture | ( | FixedVector & | center, | |
| int | limit | |||
| ) | [static] |
Definition at line 630 of file MovementMap.cpp.
References ImageFactory::createBlank(), Landscape::eOther, GroundMaps::getArenaHeight(), GroundMaps::getArenaWidth(), GroundMaps::getArenaX(), GroundMaps::getArenaY(), ImageHandle::getBits(), Image::getBits(), LandscapeMaps::getGroundMaps(), ImageHandle::getHeight(), getHeight(), GroundMaps::getLandscapeHeight(), ScorchedContext::getLandscapeMaps(), GroundMaps::getLandscapeWidth(), Landscape::getMainMap(), Landscape::getMainTexture(), ImageHandle::getWidth(), ScorchedClient::instance(), Landscape::instance(), int(), GLTexture::replace(), and Landscape::setTextureType().
Referenced by TankWeapon::setCurrentWeapon().
| fixed MovementMap::getFuel | ( | WeaponMoveTank * | weapon | ) |
Definition at line 332 of file MovementMap.cpp.
References Tank::getAccessories(), TankAccessories::getAccessoryCount(), WeaponMoveTank::getMaximumRange(), AccessoryPart::getParent(), MIN, and tank_.
Referenced by TankMovement::init(), TankAICurrentMove::makeMoveShot(), TargetCamera::mouseUp(), and TankWeapon::setCurrentWeapon().
| bool MovementMap::inShield | ( | Target * | target, | |
| Tank * | tank, | |||
| FixedVector & | position | |||
| ) | [static] |
Definition at line 266 of file MovementMap.cpp.
References Accessory::getAction(), TargetShield::getCurrentShield(), Target::getLife(), Target::getShield(), TargetLife::getTargetPosition(), Shield::inShield(), MAX, and FixedVector::Normalize().
Referenced by allowedPosition(), and getAndCheckEntry().
| bool MovementMap::movementProof | ( | ScorchedContext & | context, | |
| Target * | target, | |||
| Tank * | tank | |||
| ) | [static] |
Definition at line 214 of file MovementMap.cpp.
References Accessory::getAction(), Target::getAlive(), TargetShield::getCurrentShield(), Shield::getMovementProof(), ScorchedContext::getOptionsGame(), Target::getPlayerId(), Target::getShield(), Tank::getTeam(), Target::isTarget(), Shield::ShieldMovementAll, Shield::ShieldMovementNone, Shield::ShieldMovementSame, Shield::ShieldMovementTeam1, Shield::ShieldMovementTeam2, Shield::ShieldMovementTeam3, and Shield::ShieldMovementTeam4.
Referenced by allowedPosition(), and MovementMap().
| bool MovementMap::allowedPosition | ( | ScorchedContext & | context, | |
| Tank * | tank, | |||
| FixedVector & | position | |||
| ) | [static] |
Definition at line 282 of file MovementMap.cpp.
References TargetSpace::getCollisionSet(), ScorchedContext::getTargetSpace(), inShield(), and movementProof().
Referenced by TankMovement::moveTank().
| unsigned int MovementMap::POINT_TO_UINT | ( | unsigned int | x, | |
| unsigned int | y | |||
| ) | [protected] |
Definition at line 84 of file MovementMap.cpp.
Referenced by addPoint(), calculateAllPositions(), and calculatePosition().
| void MovementMap::addPoint | ( | unsigned int | x, | |
| unsigned int | y, | |||
| fixed | height, | |||
| fixed | dist, | |||
| std::list< unsigned int > & | edgeList, | |||
| unsigned int | sourcePt, | |||
| unsigned int | epoc | |||
| ) | [protected] |
Definition at line 139 of file MovementMap.cpp.
References arenaHeight_, arenaWidth_, arenaX_, arenaY_, context_, MovementMap::MovementMapEntry::dist, eMovement, eNoMovement, MovementMap::MovementMapEntry::epoc, getAndCheckEntry(), LandscapeMaps::getGroundMaps(), GroundMaps::getHeight(), ScorchedContext::getLandscapeMaps(), ScorchedContext::getOptionsGame(), minHeight_, POINT_TO_UINT(), and MovementMap::MovementMapEntry::type.
Referenced by calculateAllPositions(), and calculatePosition().
| void MovementMap::addPoint | ( | unsigned int | x, | |
| unsigned int | y, | |||
| fixed | height, | |||
| fixed | dist, | |||
| std::priority_queue< QueuePosition, std::vector< QueuePosition >, std::less< QueuePosition > > & | priorityQueue, | |||
| unsigned int | sourcePt, | |||
| FixedVector & | position | |||
| ) | [protected] |
Definition at line 377 of file MovementMap.cpp.
References arenaHeight_, arenaWidth_, arenaX_, arenaY_, calcDistance(), context_, MovementMap::QueuePosition::distance, eMovement, eNoMovement, getAndCheckEntry(), LandscapeMaps::getGroundMaps(), GroundMaps::getHeight(), ScorchedContext::getLandscapeMaps(), ScorchedContext::getOptionsGame(), minHeight_, POINT_TO_UINT(), MovementMap::QueuePosition::square, and MovementMap::MovementMapEntry::type.
| fixed MovementMap::getWaterHeight | ( | ) | [protected] |
Definition at line 302 of file MovementMap.cpp.
References LandscapeTex::border, context_, LandscapeTexType::eWater, LandscapeMaps::getDefinitions(), ScorchedContext::getLandscapeMaps(), ScorchedContext::getOptionsGame(), Tank::getPosition(), TankPosition::getTankPosition(), LandscapeDefinitionCache::getTex(), LandscapeTexType::getType(), LandscapeTexBorderWater::height, OptionsGame::MovementRestrictionLand, OptionsGame::MovementRestrictionLandOrAbove, and tank_.
Referenced by MovementMap().
| bool MovementMap::tankBurried | ( | ) | [protected] |
Definition at line 347 of file MovementMap.cpp.
References context_, LandscapeMaps::getGroundMaps(), GroundMaps::getInterpHeight(), ScorchedContext::getLandscapeMaps(), ScorchedContext::getOptionsGame(), Tank::getPosition(), TankPosition::getTankPosition(), and tank_.
Referenced by calculateAllPositions(), and calculatePosition().
| MovementMap::MovementMapEntry & MovementMap::getAndCheckEntry | ( | int | w, | |
| int | h | |||
| ) | [protected] |
Definition at line 102 of file MovementMap.cpp.
References checkTargets_, context_, eNoMovement, eNotInitialized, eNotSeen, getEntry(), LandscapeMaps::getGroundMaps(), GroundMaps::getHeight(), ScorchedContext::getLandscapeMaps(), inShield(), minHeight_, tank_, and MovementMap::MovementMapEntry::type.
Referenced by addPoint(), calculateAllPositions(), and calculatePosition().
MovementMapEntry* MovementMap::entries_ [protected] |
Definition at line 87 of file MovementMap.h.
Referenced by getEntry(), MovementMap(), and ~MovementMap().
int MovementMap::landscapeWidth_ [protected] |
int MovementMap::landscapeHeight_ [protected] |
int MovementMap::arenaX_ [protected] |
Definition at line 89 of file MovementMap.h.
Referenced by addPoint(), getEntry(), and MovementMap().
int MovementMap::arenaY_ [protected] |
Definition at line 89 of file MovementMap.h.
Referenced by addPoint(), getEntry(), and MovementMap().
int MovementMap::arenaWidth_ [protected] |
Definition at line 90 of file MovementMap.h.
Referenced by addPoint(), getEntry(), and MovementMap().
int MovementMap::arenaHeight_ [protected] |
Definition at line 90 of file MovementMap.h.
Referenced by addPoint(), getEntry(), and MovementMap().
fixed MovementMap::minHeight_ [protected] |
Definition at line 91 of file MovementMap.h.
Referenced by addPoint(), getAndCheckEntry(), and MovementMap().
Tank* MovementMap::tank_ [protected] |
Definition at line 92 of file MovementMap.h.
Referenced by calculateAllPositions(), calculatePosition(), getAndCheckEntry(), getFuel(), getWaterHeight(), and tankBurried().
ScorchedContext& MovementMap::context_ [protected] |
Definition at line 93 of file MovementMap.h.
Referenced by addPoint(), calculateAllPositions(), calculatePosition(), getAndCheckEntry(), getWaterHeight(), MovementMap(), and tankBurried().
std::list<Target *> MovementMap::checkTargets_ [protected] |
1.5.3