BWAPI
|
#include <BuildTilePath.h>
Public Member Functions | |
BuildTilePath () | |
void | addNode (TilePosition pos) |
void | drawPath () |
bool | isStillValid () |
Public Attributes | |
bool | isComplete |
std::list< TilePosition > | path |
Definition at line 5 of file BuildTilePath.h.
Definition at line 4 of file BuildTilePath.cpp.
: isComplete(false) { }
void BuildTilePath::addNode | ( | TilePosition | pos | ) |
Definition at line 9 of file BuildTilePath.cpp.
References path.
Referenced by PathFinderClass::CreateTilePath().
{ path.push_front(pos); }
void BuildTilePath::drawPath | ( | ) |
Definition at line 14 of file BuildTilePath.cpp.
References BWAPI::Broodwar, BWAPI::Game::drawLineMap(), BWAPI::TilePositions::None, BWAPI::BulletTypes::None, path, BWAPI::TilePosition::x(), BWAPI::TilePosition::y(), and BWAPI::Colors::Yellow.
{ TilePosition previousTile = BWAPI::TilePositions::None; for each(const TilePosition &pos in path) { if(previousTile != BWAPI::TilePositions::None) BWAPI::Broodwar->drawLineMap(pos.x() * 32 + 16, pos.y() * 32 + 16, previousTile.x() * 32 + 16, previousTile.y() * 32 + 16, BWAPI::Colors::Yellow); previousTile = pos; } }
bool BuildTilePath::isStillValid | ( | ) |
Definition at line 26 of file BuildTilePath.cpp.
References Singleton< T >::Instance(), MapHelper::isTileWalkable(), and path.
Referenced by WorkerScoutTask::update().
{ for each(const TilePosition &pos in path) { if(!BuildingPlacer::Instance().isTileWalkable(pos)) return false; } return true; }
Definition at line 12 of file BuildTilePath.h.
Referenced by PathFinderClass::CreateTilePath(), and WorkerScoutTask::update().
std::list<TilePosition> BuildTilePath::path |
Definition at line 16 of file BuildTilePath.h.
Referenced by addNode(), drawPath(), isStillValid(), and WorkerScoutTask::update().