BWAPI
|
00001 #pragma once 00002 00003 #include "Interface.h" 00004 00005 #include "Singleton.h" 00006 #include "Base.h" 00007 00008 class BaseTrackerClass 00009 { 00010 public: 00011 BaseTrackerClass(); 00012 00013 Base createBase(std::set<TilePosition> tiles, Region region, bool startLocation, TilePosition position = BWAPI::TilePositions::None, const UnitGroup &resources = UnitGroup()); 00014 00015 void update(); 00016 void onDiscover(Unit unit); 00017 void onMorphRenegade(Unit unit, Player previousPlayer, BWAPI::UnitType previousType); 00018 void onDestroy(Unit unit); 00019 00020 const std::set<Base> &getAllBases() const { return mBases; }; 00021 std::set<Base> getResourceBases(); 00022 std::set<Base> getActiveBases(bool activeInFuture = false, Player player = BWAPI::Broodwar->self()); 00023 std::set<Base> getEnemyActiveBases(bool activeInFuture = false); 00024 std::set<Base> getEnemyBases(); 00025 std::set<Base> getAllyBases(); 00026 std::set<Base> getPlayerBases(Player player = BWAPI::Broodwar->self()); 00027 std::set<Base> getImportantBases(Player player = BWAPI::Broodwar->self()); 00028 std::set<Base> getEnemyImportantBases(); 00029 00030 Base getBase(TilePosition location) { return mTileToBase[location]; } 00031 00032 private: 00033 std::set<Base> mBases; 00034 std::map<TilePosition, Base> mTileToBase; 00035 }; 00036 00037 typedef Singleton<BaseTrackerClass> BaseTracker;