BWAPI
|
00001 #pragma once 00002 #include "ArbitratorUnitData.h" 00003 #include <BWAPI.h> 00004 00005 // Keep in mind: spamming attack-move actions every frame will cause the unit to move without attacking 00006 // (hence BWAPI lastOrderFrame?) 00007 00008 class LowLevelAction; 00009 00014 class Arbitration 00015 { 00016 public: 00017 typedef ArbitratorUnitData::ActionImportance ActionImportance; 00018 00019 Arbitration() {} 00020 00021 ~Arbitration() {} 00022 00023 void onStart() {} 00024 00025 void onFrame() {} 00026 00027 //void onFrame() 00028 //{ 00029 // executeActions(); 00030 //} 00031 00032 void onEnd() {} 00033 00040 void submitAction(BWAPI::Unit* unit, const LowLevelAction &action, ActionImportance importance) 00041 { 00042 unused(importance); 00043 00044 action.execute(unit); 00045 } 00046 00053 void submitAction(const PersistentUnitGroup* group, const LowLevelAction &action, ActionImportance importance) 00054 { 00055 unused(importance); 00056 00057 action.execute(group); 00058 } 00059 00060 protected: 00065 //void executeActions(); 00066 00070 // Use hash_set? 00071 //std::set<BWAPI::Unit*> m_unitsWithSubmittedActions; 00072 };