BWAPI
Skynet/Skynet/AdvancedGroup.cpp
Go to the documentation of this file.
00001 #include "AdvancedGroup.h"
00002 
00003 void AdvancedGroup::update(Goal goal)
00004 {
00005         // Reshuffle the groups
00006         // closest unit to the goal is start of that group
00007 
00008         if(mAllUnits.empty())
00009                 return;
00010 
00011         Unit closestUnit = mAllUnits.getClosestUnit(goal.getPositionForMerge());
00012         if(mCurrectGoalGroup.count(closestUnit) == 0)
00013         {
00014                 ;
00015         }
00016 
00017         mLastGoal = goal;
00018 }
00019 
00020 void AdvancedGroup::addUnit(Unit unit)
00021 {
00022         mUnitBehaviours[unit] = Behaviour(unit);
00023         mReinforcements.insert(unit);
00024         mAllUnits.insert(unit);
00025 }
00026 
00027 void AdvancedGroup::removeUnits(Unit unit)
00028 {
00029         mCurrectGoalGroup.erase(unit);
00030         mReinforcements.erase(unit);
00031 
00032         for(std::list<std::pair<UnitGroup, Goal>>::iterator it = mStrandedUnits.begin(); it != mStrandedUnits.end(); ++it)
00033                 it->first.erase(unit);
00034 
00035         mUnitBehaviours[unit].onDeleted();
00036         mUnitBehaviours.erase(unit);
00037 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines