BWAPI
Skynet/Skynet/BuildTilePath.cpp
Go to the documentation of this file.
00001 #include "BuildTilePath.h"
00002 #include "BuildingPlacer.h"
00003 
00004 BuildTilePath::BuildTilePath()
00005         : isComplete(false)
00006 {
00007 }
00008 
00009 void BuildTilePath::addNode(TilePosition pos)
00010 {
00011         path.push_front(pos);
00012 }
00013 
00014 void BuildTilePath::drawPath()
00015 {
00016         TilePosition previousTile = BWAPI::TilePositions::None;
00017         for each(const TilePosition &pos in path)
00018         {
00019                 if(previousTile != BWAPI::TilePositions::None)
00020                         BWAPI::Broodwar->drawLineMap(pos.x() * 32 + 16, pos.y() * 32 + 16, previousTile.x() * 32 + 16, previousTile.y() * 32 + 16, BWAPI::Colors::Yellow);
00021 
00022                 previousTile = pos;
00023         }
00024 }
00025 
00026 bool BuildTilePath::isStillValid()
00027 {
00028         for each(const TilePosition &pos in path)
00029         {
00030                 if(!BuildingPlacer::Instance().isTileWalkable(pos))
00031                         return false;
00032         }
00033 
00034         return true;
00035 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines