BWAPI
|
00001 #pragma once 00002 #include "Micro/Goals/Goal.h" 00003 #include "BWTA.h" 00004 #include <set> 00005 00006 /*** 00007 * A helper/wrapper on top of Goal to facilitate defense 00008 * No subgoals, check completion on Micro 00009 */ 00010 class DefendGoal: public Goal 00011 { 00012 BWAPI::Position _defPos; 00013 BWTA::Chokepoint* _choke; 00014 BWTA::BaseLocation* _base; 00015 int _eUnits; 00016 int _nbWorkers; 00017 inline void bidDefUnits(); 00018 BWAPI::Position _threatMiddle; 00019 public: 00020 DefendGoal(BWTA::Chokepoint* c, int priority = 80, int firstFrame = 0); 00021 DefendGoal(BWTA::BaseLocation* b, int priority = 80, int firstFrame = 0); 00022 DefendGoal(BWAPI::Position p, int priority = 80, int firstFrame = 0); 00023 virtual void achieve(); // overload 00024 virtual void check(); // overload 00025 00026 virtual void onOffer(std::set<BWAPI::Unit*> objects); 00027 virtual void onRevoke(BWAPI::Unit* u, double bid); 00028 virtual void onUnitDestroy(BWAPI::Unit* unit); 00029 virtual std::string getName() const; 00030 virtual std::string getShortName() const; 00031 virtual void update(); 00032 };