BWAPI
Public Member Functions | Private Attributes
Goal Class Reference

#include <Goal.h>

Collaboration diagram for Goal:
Collaboration graph
[legend]

List of all members.

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 PositiongetPosition () const
const UnitgetUnit () const
const BasegetBase () const
const UnitGroupgetAvoidUnits () const
const UnitGroupgetEngageUnits () const
Position getPositionForMerge () const

Private Attributes

GoalType mGoalType
ActionType mActionType
Position mPosition
Unit mUnit
Base mBase
UnitGroup mAvoidUnits
UnitGroup mEngageUnits

Detailed Description

Definition at line 36 of file Goal.h.


Constructor & Destructor Documentation

Definition at line 3 of file Goal.cpp.

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.

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)
{
}

Member Function Documentation

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; }

Here is the caller graph for this function:

const UnitGroup& Goal::getAvoidUnits ( ) const [inline]

Definition at line 51 of file Goal.h.

References mAvoidUnits.

{ return mAvoidUnits; }
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; }

Here is the caller graph for this function:

const UnitGroup& Goal::getEngageUnits ( ) const [inline]

Definition at line 52 of file Goal.h.

References mEngageUnits.

Referenced by GoalAction::update().

{ return mEngageUnits; }

Here is the caller graph for this function:

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; }

Here is the caller graph for this function:

const Position& Goal::getPosition ( ) const [inline]

Definition at line 48 of file Goal.h.

References mPosition.

Referenced by GoalAction::update().

{ return mPosition; }

Here is the caller graph for this function:

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);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const Unit& Goal::getUnit ( ) const [inline]

Definition at line 49 of file Goal.h.

References mUnit.

Referenced by GoalAction::update().

{ return mUnit; }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 58 of file Goal.h.

Referenced by getActionType().

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().

Definition at line 65 of file Goal.h.

Referenced by getEngageUnits(), and getPositionForMerge().

Definition at line 57 of file Goal.h.

Referenced by getGoalType(), and getPositionForMerge().

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines