BWAPI
|
#include <Goal.h>
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 |
Goal::Goal | ( | int | priority = 50 , |
int | firstFrame = 0 |
||
) |
Goal::Goal | ( | pSubgoal | s, |
int | priority = 50 , |
||
int | firstFrame = 0 |
||
) |
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 |
||
) |
Goal::~Goal | ( | ) | [virtual] |
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.
void Goal::addNeededUnits | ( | const std::map< BWAPI::UnitType, int > & | neededUnits | ) |
void Goal::addSubgoal | ( | pSubgoal | s | ) |
void Goal::bidOnMilitaryUnits | ( | ) | [protected] |
void Goal::bidOnUnit | ( | BWAPI::Unit * | u | ) | [protected] |
void Goal::bidOnUnitType | ( | const BWAPI::UnitType & | ut | ) | [protected] |
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
void Goal::check | ( | ) | [virtual] |
string Goal::getName | ( | ) | const [virtual] |
Implements Arbitrator::Controller< BWAPI::Unit *, double >.
Reimplemented in DefendGoal, and FirstScoutGoal.
string Goal::getShortName | ( | ) | const [virtual] |
Reimplemented from Arbitrator::Controller< BWAPI::Unit *, double >.
Reimplemented in DefendGoal.
GoalStatus Goal::getStatus | ( | ) | const |
void Goal::onOffer | ( | std::set< BWAPI::Unit * > | objects | ) | [virtual] |
Controller methods.
Implements Arbitrator::Controller< BWAPI::Unit *, double >.
Reimplemented in FirstScoutGoal, DefendGoal, and ExploreGoal.
void Goal::onRevoke | ( | BWAPI::Unit * | u, |
double | bid | ||
) | [virtual] |
Implements Arbitrator::Controller< BWAPI::Unit *, double >.
Reimplemented in DefendGoal.
void Goal::onUnitDestroy | ( | BWAPI::Unit * | unit | ) | [virtual] |
Reimplemented in DefendGoal.
void Goal::setFirstFrame | ( | int | firstFrame | ) |
void Goal::setPriority | ( | int | priority | ) |
void Goal::setStatus | ( | GoalStatus | s | ) |
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.
friend class GoalManager [friend] |
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] |
GoalStatus Goal::_status [protected] |
Status.
std::list<pSubgoal> Goal::_subgoals [protected] |
Subgoals.
UnitsGroup Goal::_unitsGroup [protected] |
Units it can use.