BWAPI
|
00001 #pragma once 00002 00003 #include "Interface.h" 00004 #include "TypeSafeEnum.h" 00005 #include "UnitGroup.h" 00006 #include "Base.h" 00007 #include "AOEThreat.h" 00008 00009 struct GoalTypeDef 00010 { 00011 enum type 00012 { 00013 None, 00014 Position, 00015 Unit, 00016 UnitGroup, 00017 Base 00018 }; 00019 }; 00020 typedef SafeEnum<GoalTypeDef> GoalType; 00021 00022 struct ActionTypeDef 00023 { 00024 enum type 00025 { 00026 None, 00027 Defend, 00028 Hold, 00029 FallBack, 00030 Retreat, 00031 Attack 00032 }; 00033 }; 00034 typedef SafeEnum<ActionTypeDef> ActionType; 00035 00036 class Goal 00037 { 00038 public: 00039 Goal(); 00040 Goal(ActionType type, Position position, UnitGroup engageUnits = UnitGroup(), UnitGroup avoidUnits = UnitGroup()); 00041 Goal(ActionType type, Unit unit, UnitGroup engageUnits = UnitGroup(), UnitGroup avoidUnits = UnitGroup()); 00042 Goal(ActionType type, UnitGroup engageUnits, UnitGroup avoidUnits = UnitGroup()); 00043 Goal(ActionType type, Base base, UnitGroup engageUnits = UnitGroup(), UnitGroup avoidUnits = UnitGroup()); 00044 00045 GoalType getGoalType() const { return mGoalType; } 00046 ActionType getActionType() const { return mActionType; } 00047 00048 const Position &getPosition() const { return mPosition; } 00049 const Unit &getUnit() const { return mUnit; } 00050 const Base &getBase() const { return mBase; } 00051 const UnitGroup &getAvoidUnits() const { return mAvoidUnits; } 00052 const UnitGroup &getEngageUnits() const { return mEngageUnits; } 00053 00054 Position getPositionForMerge() const; 00055 00056 private: 00057 GoalType mGoalType; 00058 ActionType mActionType; 00059 00060 Position mPosition; 00061 Unit mUnit; 00062 Base mBase; 00063 00064 UnitGroup mAvoidUnits; 00065 UnitGroup mEngageUnits; 00066 };