BWAPI
Public Member Functions | Private Attributes
AdvancedGroup Class Reference

#include <AdvancedGroup.h>

Collaboration diagram for AdvancedGroup:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AdvancedGroup ()
void update (Goal goal)
void addUnit (Unit unit)
void removeUnits (Unit unit)

Private Attributes

UnitGroup mAllUnits
std::map< Unit, BehaviourmUnitBehaviours
Goal mLastGoal
UnitGroup mCurrectGoalGroup
UnitGroup mReinforcements
std::list< std::pair
< UnitGroup, Goal > > 
mStrandedUnits

Detailed Description

Definition at line 8 of file AdvancedGroup.h.


Constructor & Destructor Documentation


Member Function Documentation

void AdvancedGroup::addUnit ( Unit  unit)

Definition at line 20 of file AdvancedGroup.cpp.

References UnitGroup::insert(), mAllUnits, mReinforcements, and mUnitBehaviours.

Here is the call graph for this function:

Definition at line 27 of file AdvancedGroup.cpp.

References UnitGroup::erase(), mCurrectGoalGroup, mReinforcements, mStrandedUnits, and mUnitBehaviours.

{
        mCurrectGoalGroup.erase(unit);
        mReinforcements.erase(unit);

        for(std::list<std::pair<UnitGroup, Goal>>::iterator it = mStrandedUnits.begin(); it != mStrandedUnits.end(); ++it)
                it->first.erase(unit);

        mUnitBehaviours[unit].onDeleted();
        mUnitBehaviours.erase(unit);
}

Here is the call graph for this function:

void AdvancedGroup::update ( Goal  goal)

Definition at line 3 of file AdvancedGroup.cpp.

References UnitGroup::count(), UnitGroup::empty(), UnitGroup::getClosestUnit(), Goal::getPositionForMerge(), mAllUnits, mCurrectGoalGroup, and mLastGoal.

{
        // Reshuffle the groups
        // closest unit to the goal is start of that group

        if(mAllUnits.empty())
                return;

        Unit closestUnit = mAllUnits.getClosestUnit(goal.getPositionForMerge());
        if(mCurrectGoalGroup.count(closestUnit) == 0)
        {
                ;
        }

        mLastGoal = goal;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 19 of file AdvancedGroup.h.

Referenced by addUnit(), and update().

Definition at line 23 of file AdvancedGroup.h.

Referenced by removeUnits(), and update().

Definition at line 22 of file AdvancedGroup.h.

Referenced by update().

Definition at line 25 of file AdvancedGroup.h.

Referenced by addUnit(), and removeUnits().

std::list<std::pair<UnitGroup, Goal> > AdvancedGroup::mStrandedUnits [private]

Definition at line 27 of file AdvancedGroup.h.

Referenced by removeUnits().

Definition at line 20 of file AdvancedGroup.h.

Referenced by addUnit(), and removeUnits().


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