BWAPI
|
00001 #pragma once 00002 00003 #include "Interface.h" 00004 #include "Singleton.h" 00005 00006 #include "AOEThreat.h" 00007 00008 class AOEThreatTrackerClass 00009 { 00010 public: 00011 void update(); 00012 00013 AOEThreat getClosestGroundThreat(const Position &pos) const; 00014 AOEThreat getClosestAirThreat(const Position &pos) const; 00015 AOEThreat getClosestEnergyThreat(const Position &pos) const; 00016 AOEThreat getClosestThreat(Unit unit) const; 00017 00018 bool isTargetOfThreat(Unit unit) const; 00019 00020 private: 00021 std::set<AOEThreat> mAllThreats; 00022 std::map<Unit, AOEThreat> mUnitThreats; 00023 std::map<BWAPI::Bullet*, AOEThreat> mBulletThreats; 00024 }; 00025 typedef Singleton<AOEThreatTrackerClass> AOEThreatTracker;