BWAPI
|
00001 #pragma once 00002 #include <BWAPI.h> 00003 #include <BWTA.h> 00004 00005 #include "UnitManager/UnitGroup.h" 00006 class UnitGroup; 00007 00008 typedef enum 00009 { 00010 DEFEND_BASE_OBJ = 0, 00011 ATTACK_BASE_OBJ = 1, 00012 EXPLORE_OBJ = 2, 00013 DROP_OBJ = 3, 00014 PATROL_OBJ = 4, 00015 BLOCK_SLOPE_OBJ = 5, 00016 ND_OBJ = 0 00017 } objective_t; 00018 00019 typedef enum 00020 { 00021 OBJ_IN_PROGRESS = 1, 00022 MOVE_TO_OBJ = 2, 00023 OBJ_NOT_ASSIGNED = 3, 00024 FLEE_OBJ = 4, 00025 ND_OBJ_STATUS = 0 00026 } objectiveStatus_t; 00027 00028 class Objective 00029 { 00030 protected : 00031 objective_t type_; 00032 objectiveStatus_t status_; 00033 double reqPower_; 00034 double minReqPower_; 00035 BWTA::BaseLocation* baseLoc_; 00036 BWAPI::Position* pos_; 00037 std::list<UnitGroup*> lGroup_; 00039 /*************** Constructors and destructors ***************/ 00040 00041 public : 00046 Objective(); 00047 00051 virtual ~Objective(); 00052 00053 /************************* Accessors ************************/ 00054 00059 inline objective_t type() { return this->type_; } 00060 00065 inline objectiveStatus_t status() { return this->status_; } 00066 00071 inline double reqPower() { return this->reqPower_; } 00072 00077 inline BWTA::BaseLocation* baseLoc() { return this->baseLoc_; } 00078 00083 inline BWAPI::Position* pos() { return this->pos_; } 00084 00085 /************************* Execution ************************/ 00086 00090 virtual void start() = 0; 00091 00095 virtual void stop() = 0; 00096 00101 void assignGroup(UnitGroup* group); 00102 };