|
BWAPI
|
#include <Goal.h>

Public Member Functions | |
| Goal () | |
| Goal (ActionType type, Position position, UnitGroup engageUnits=UnitGroup(), UnitGroup avoidUnits=UnitGroup()) | |
| Goal (ActionType type, Unit unit, UnitGroup engageUnits=UnitGroup(), UnitGroup avoidUnits=UnitGroup()) | |
| Goal (ActionType type, UnitGroup engageUnits, UnitGroup avoidUnits=UnitGroup()) | |
| Goal (ActionType type, Base base, UnitGroup engageUnits=UnitGroup(), UnitGroup avoidUnits=UnitGroup()) | |
| GoalType | getGoalType () const |
| ActionType | getActionType () const |
| const Position & | getPosition () const |
| const Unit & | getUnit () const |
| const Base & | getBase () const |
| const UnitGroup & | getAvoidUnits () const |
| const UnitGroup & | getEngageUnits () const |
| Position | getPositionForMerge () const |
Private Attributes | |
| GoalType | mGoalType |
| ActionType | mActionType |
| Position | mPosition |
| Unit | mUnit |
| Base | mBase |
| UnitGroup | mAvoidUnits |
| UnitGroup | mEngageUnits |
| Goal::Goal | ( | ) |
Definition at line 3 of file Goal.cpp.
: mGoalType(GoalType::None) , mActionType(ActionType::None) , mPosition() , mUnit() , mBase() , mAvoidUnits() , mEngageUnits() { }
| Goal::Goal | ( | ActionType | type, |
| Position | position, | ||
| UnitGroup | engageUnits = UnitGroup(), |
||
| UnitGroup | avoidUnits = UnitGroup() |
||
| ) |
Definition at line 14 of file Goal.cpp.
: mGoalType(GoalType::Position) , mActionType(type) , mPosition(position) , mUnit() , mBase() , mAvoidUnits(avoidUnits) , mEngageUnits(engageUnits) { }
| Goal::Goal | ( | ActionType | type, |
| Unit | unit, | ||
| UnitGroup | engageUnits = UnitGroup(), |
||
| UnitGroup | avoidUnits = UnitGroup() |
||
| ) |
Definition at line 25 of file Goal.cpp.
: mGoalType(GoalType::Unit) , mActionType(type) , mPosition(BWAPI::Positions::None) , mUnit(unit) , mBase() , mAvoidUnits(avoidUnits) , mEngageUnits(engageUnits) { }
| Goal::Goal | ( | ActionType | type, |
| UnitGroup | engageUnits, | ||
| UnitGroup | avoidUnits = UnitGroup() |
||
| ) |
Definition at line 36 of file Goal.cpp.
: mGoalType(GoalType::UnitGroup) , mActionType(type) , mPosition(BWAPI::Positions::None) , mUnit() , mBase() , mAvoidUnits(avoidUnits) , mEngageUnits(engageUnits) { }
| Goal::Goal | ( | ActionType | type, |
| Base | base, | ||
| UnitGroup | engageUnits = UnitGroup(), |
||
| UnitGroup | avoidUnits = UnitGroup() |
||
| ) |
Definition at line 47 of file Goal.cpp.
: mGoalType(GoalType::Base) , mActionType(type) , mPosition(BWAPI::Positions::None) , mUnit() , mBase(base) , mAvoidUnits(avoidUnits) , mEngageUnits(engageUnits) { }
| ActionType Goal::getActionType | ( | ) | const [inline] |
Definition at line 46 of file Goal.h.
References mActionType.
Referenced by BasicUnitAction::update(), DetectorAction::update(), PsiStormAction::update(), DefenseSquadTask::update(), DefaultSquadTask::update(), and DefenseSquadTask::updateRequirements().
{ return mActionType; }

| const UnitGroup& Goal::getAvoidUnits | ( | ) | const [inline] |
| const Base& Goal::getBase | ( | ) | const [inline] |
Definition at line 50 of file Goal.h.
References mBase.
Referenced by GoalAction::update(), PsiStormAction::update(), DefenseSquadTask::update(), DefaultSquadTask::update(), and DefenseSquadTask::updateRequirements().
{ return mBase; }

| const UnitGroup& Goal::getEngageUnits | ( | ) | const [inline] |
Definition at line 52 of file Goal.h.
References mEngageUnits.
Referenced by GoalAction::update().
{ return mEngageUnits; }

| GoalType Goal::getGoalType | ( | ) | const [inline] |
Definition at line 45 of file Goal.h.
References mGoalType.
Referenced by GoalAction::update(), PsiStormAction::update(), DefaultSquadTask::update(), and ObserverScoutTask::update().
{ return mGoalType; }

| const Position& Goal::getPosition | ( | ) | const [inline] |
Definition at line 48 of file Goal.h.
References mPosition.
Referenced by GoalAction::update().
{ return mPosition; }

| Position Goal::getPositionForMerge | ( | ) | const |
Definition at line 58 of file Goal.cpp.
References GoalTypeDef::Base, BWAPI::Broodwar, UnitGroup::getCenter(), mBase, mEngageUnits, mGoalType, mPosition, mUnit, GoalTypeDef::Position, SafeEnum< def, inner >::underlying(), GoalTypeDef::Unit, and GoalTypeDef::UnitGroup.
Referenced by AdvancedGroup::update().
{
switch(mGoalType.underlying())
{
case GoalType::Position:
return mPosition;
case GoalType::Base:
return mBase->getCenterLocation();
case GoalType::Unit:
return mUnit->getPosition();
case GoalType::UnitGroup:
return mEngageUnits.getCenter();
}
return Position(BWAPI::Broodwar->mapWidth()*16, BWAPI::Broodwar->mapHeight()*16);
}

| const Unit& Goal::getUnit | ( | ) | const [inline] |
Definition at line 49 of file Goal.h.
References mUnit.
Referenced by GoalAction::update().
{ return mUnit; }

ActionType Goal::mActionType [private] |
Definition at line 58 of file Goal.h.
Referenced by getActionType().
UnitGroup Goal::mAvoidUnits [private] |
Definition at line 64 of file Goal.h.
Referenced by getAvoidUnits().
Base Goal::mBase [private] |
Definition at line 62 of file Goal.h.
Referenced by getBase(), and getPositionForMerge().
UnitGroup Goal::mEngageUnits [private] |
Definition at line 65 of file Goal.h.
Referenced by getEngageUnits(), and getPositionForMerge().
GoalType Goal::mGoalType [private] |
Definition at line 57 of file Goal.h.
Referenced by getGoalType(), and getPositionForMerge().
Position Goal::mPosition [private] |
Definition at line 60 of file Goal.h.
Referenced by getPosition(), and getPositionForMerge().
Unit Goal::mUnit [private] |
Definition at line 61 of file Goal.h.
Referenced by getPositionForMerge(), and getUnit().
1.7.6.1