BWAPI
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
Goal Class Reference

#include <Goal.h>

Inheritance diagram for Goal:
Inheritance graph
[legend]
Collaboration diagram for Goal:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Goal (int priority=50, int firstFrame=0)
 Goal (pSubgoal s, int priority=50, int firstFrame=0)
 Goal (const std::map< BWAPI::UnitType, int > &nU, pSubgoal s, int priority=50, int firstFrame=0)
 Goal (const std::map< BWAPI::UnitType, int > &nU, int priority=50, int firstFrame=0)
virtual ~Goal ()
virtual void onOffer (std::set< BWAPI::Unit * > objects)
 Controller methods.
virtual void onRevoke (BWAPI::Unit *u, double bid)
virtual std::string getName () const
virtual std::string getShortName () const
virtual void update ()
virtual void onUnitDestroy (BWAPI::Unit *unit)
virtual void achieve ()
virtual void check ()
virtual void cancel ()
void addSubgoal (pSubgoal s)
void addNeededUnits (const std::map< BWAPI::UnitType, int > &neededUnits)
void setFirstFrame (int firstFrame)
void setPriority (int priority)
void setStatus (GoalStatus s)
GoalStatus getStatus () const

Protected Member Functions

void bidOnUnitType (const BWAPI::UnitType &ut)
void bidOnMilitaryUnits ()
void bidOnUnit (BWAPI::Unit *u)

Protected Attributes

UnitsGroup _unitsGroup
 Units it can use.
std::list< BWAPI::Unit * > _incompleteUnits
std::map< BWAPI::UnitType, int > _neededUnits
 Preconditions.
std::set< BWAPI::Unit * > _biddedOn
int _priority
int _firstFrame
int _firstActive
std::list< pSubgoal_subgoals
 Subgoals.
GoalStatus _status
 Status.

Friends

class GoalManager

Constructor & Destructor Documentation

Goal::Goal ( int  priority = 50,
int  firstFrame = 0 
)

Here is the call graph for this function:

Goal::Goal ( pSubgoal  s,
int  priority = 50,
int  firstFrame = 0 
)

Here is the call graph for this function:

Goal::Goal ( const std::map< BWAPI::UnitType, int > &  nU,
pSubgoal  s,
int  priority = 50,
int  firstFrame = 0 
)
Goal::Goal ( const std::map< BWAPI::UnitType, int > &  nU,
int  priority = 50,
int  firstFrame = 0 
)

Here is the call graph for this function:

Goal::~Goal ( ) [virtual]

Here is the call graph for this function:


Member Function Documentation

void Goal::achieve ( ) [virtual]

Check for the goal achievement

Select the Subgoal which is faster to realize

Default behavior of the goal is to update the _unitsGroup in achieve/cancel

Reimplemented in FirstScoutGoal, DefendGoal, AttackGoal, DropGoal, AvoidNukeGoal, ExploreGoal, and RegroupGoal.

Here is the call graph for this function:

Here is the caller graph for this function:

void Goal::addNeededUnits ( const std::map< BWAPI::UnitType, int > &  neededUnits)

Here is the caller graph for this function:

void Goal::bidOnMilitaryUnits ( ) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

void Goal::bidOnUnit ( BWAPI::Unit *  u) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

void Goal::bidOnUnitType ( const BWAPI::UnitType &  ut) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

void Goal::cancel ( ) [virtual]

Does nothing, to be overwritten in cancelable goals Default behavior of the goal is to update the _unitsGroup in achieve/cancel

Here is the call graph for this function:

Here is the caller graph for this function:

void Goal::check ( ) [virtual]

Reimplemented in DefendGoal.

Here is the caller graph for this function:

string Goal::getName ( ) const [virtual]
string Goal::getShortName ( ) const [virtual]

Reimplemented from Arbitrator::Controller< BWAPI::Unit *, double >.

Reimplemented in DefendGoal.

void Goal::onOffer ( std::set< BWAPI::Unit * >  objects) [virtual]

Controller methods.

Implements Arbitrator::Controller< BWAPI::Unit *, double >.

Reimplemented in FirstScoutGoal, DefendGoal, and ExploreGoal.

Here is the call graph for this function:

void Goal::onRevoke ( BWAPI::Unit *  u,
double  bid 
) [virtual]

Implements Arbitrator::Controller< BWAPI::Unit *, double >.

Reimplemented in DefendGoal.

Here is the call graph for this function:

void Goal::onUnitDestroy ( BWAPI::Unit *  unit) [virtual]

Reimplemented in DefendGoal.

Here is the call graph for this function:

Here is the caller graph for this function:

void Goal::setFirstFrame ( int  firstFrame)
void Goal::setPriority ( int  priority)
void Goal::update ( ) [virtual]

Update incomplete units

Wait for the first frame trigger (if existing)

Request needed units

Implements Arbitrator::Controller< BWAPI::Unit *, double >.

Reimplemented in DefendGoal.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class GoalManager [friend]

Member Data Documentation

std::set<BWAPI::Unit*> Goal::_biddedOn [protected]
int Goal::_firstActive [protected]
int Goal::_firstFrame [protected]
std::list<BWAPI::Unit*> Goal::_incompleteUnits [protected]
std::map<BWAPI::UnitType, int> Goal::_neededUnits [protected]

Preconditions.

int Goal::_priority [protected]

Status.

std::list<pSubgoal> Goal::_subgoals [protected]

Subgoals.

Units it can use.


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