BWAPI
|
00001 #pragma once 00002 #include <BWAPI.h> 00003 #include <BWTA.h> 00004 #include <Utils/CSingleton.h> 00005 #include <Macro/Arbitrator.h> 00006 #include "Macro/InformationManager.h" 00007 00008 class UnitsGroup; 00009 class ScoutController; 00010 00011 class WarManager: public CSingleton<WarManager>, public Arbitrator::Controller<BWAPI::Unit*,double> 00012 { 00013 friend class CSingleton<WarManager>; 00014 BWTA::BaseLocation* home; 00015 WarManager(); 00016 ~WarManager(); 00017 std::list<UnitsGroup *> promptedRemove; 00018 bool remove(UnitsGroup* u); 00019 InformationManager* informationManager; 00020 public: 00021 std::list<UnitsGroup*> unitsGroups; 00022 virtual void onOffer(std::set<BWAPI::Unit*> units); 00023 virtual void onRevoke(BWAPI::Unit* unit, double bid); 00024 virtual std::string getName() const; 00025 virtual void update(); 00026 void onUnitCreate(BWAPI::Unit* unit); 00027 void onUnitDestroy(BWAPI::Unit* unit); 00028 void sendGroupToAttack( UnitsGroup* ug); 00029 void sendGroupToDefense( UnitsGroup* ug); 00030 void promptRemove(UnitsGroup* ug);//Guarantee that on the nextFrame : 00031 //-The target of the units of this UG will be their position so they are idling 00032 //-The unitsgroup will be removed from unitsGroups and deleted 00033 }; 00034