BWAPI
Public Member Functions | Protected Member Functions | Protected Attributes
UnitSet Class Reference

#include <UnitSet.h>

List of all members.

Public Member Functions

 UnitSet ()
 default constructor
 UnitSet (groupObjective_t obj, BWAPI::Position pos)
 init constructor (with the objective of the group)
 UnitSet (BWAPI::Position regroupPos)
 init constructor
 ~UnitSet ()
 destructor
BWAPI::Position curPos () const
BWAPI::Position pos () const
 return the average position of the group
BWAPI::Position objPos () const
 return the average position of the objective
bool empty () const
 check if the group is empty
int nbUnits () const
 return the number of units that belong to the current group
void moveTo (BWAPI::Position pos)
 move to the desired position
void attackTo (const BWAPI::Position pos)
 attack to the desired position
void patrolTo (BWAPI::Position pos)
 patrol to the desired position
void stop ()
 stop the group
bool canFulFillObj (Objective *obj) const
 check if the current group can fulfill the input objective
bool requires (BWAPI::Unit *unit) const
 check if the current group requires the input type of unit
void addUnit (BWAPI::Unit *unit)
 add a new unit to the group

Protected Member Functions

void updateAvgPos ()
 update the average position of the group

Protected Attributes

std::list< BWAPI::Unit * > lUnits_
groupObjective_t objective_
groupStatus_t status_
BWAPI::Position curPos_
BWAPI::Position objPos_

Constructor & Destructor Documentation

default constructor

UnitSet::UnitSet ( groupObjective_t  obj,
BWAPI::Position  pos 
)

init constructor (with the objective of the group)

Parameters:
obj: the objective of the group
pos: the position associated to the objective
UnitSet::UnitSet ( BWAPI::Position  regroupPos)

init constructor

Parameters:
pos: the position to regroup units

destructor


Member Function Documentation

void UnitSet::addUnit ( BWAPI::Unit *  unit)

add a new unit to the group

Parameters:
unit: the input unit
void UnitSet::attackTo ( const BWAPI::Position  pos)

attack to the desired position

Parameters:
pos: the position to go to
bool UnitSet::canFulFillObj ( Objective obj) const

check if the current group can fulfill the input objective

check if the current group can fulfill the inpût objective

Parameters:
obj: the input objective
Returns:
true if the group can fulfill the objective

Here is the call graph for this function:

BWAPI::Position UnitSet::curPos ( ) const [inline]
bool UnitSet::empty ( ) const [inline]

check if the group is empty

Returns:
true if the group is empty
void UnitSet::moveTo ( BWAPI::Position  pos)

move to the desired position

Parameters:
pos: the position to go to
int UnitSet::nbUnits ( ) const [inline]

return the number of units that belong to the current group

Returns:
the number of units that belong to the current group
BWAPI::Position UnitSet::objPos ( ) const

return the average position of the objective

Returns:
the average position of the objective
void UnitSet::patrolTo ( BWAPI::Position  pos)

patrol to the desired position

Parameters:
pos: the position to go to
BWAPI::Position UnitSet::pos ( ) const

return the average position of the group

Returns:
the average position of the group
bool UnitSet::requires ( BWAPI::Unit *  unit) const

check if the current group requires the input type of unit

Parameters:
unit: the input unit
Returns:
true if the group requires the input unit
void UnitSet::stop ( )

stop the group

void UnitSet::updateAvgPos ( ) [protected]

update the average position of the group


Member Data Documentation

BWAPI::Position UnitSet::curPos_ [protected]

average postion of the group on the map

std::list<BWAPI::Unit*> UnitSet::lUnits_ [protected]

list of units contained in the group

objective of the group

BWAPI::Position UnitSet::objPos_ [protected]

average postion of the objective of the group

status of the group


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