BWAPI
|
#include <Manager.h>
Public Member Functions | |
virtual void | onMatchStart () |
virtual void | update () |
virtual void | draw () |
virtual void | addAgent (Agent &t) |
virtual Agent * | removeAgent (BWAPI::UnitType ut) |
void | removeAllAgents () |
virtual void | addTask (Task &t) |
virtual void | doTask (Task &t) |
virtual int | mwtpNext (BWAPI::UnitType &ut) |
virtual int | mwtpLast (BWAPI::UnitType &ut) |
virtual int | estimateCost (Task &t) |
int | numAgents () const |
int | numAgents (BWAPI::UnitType type) |
virtual const std::string & | getName () const |
Protected Member Functions | |
AgentSet | getAgentsOfType (BWAPI::UnitType type) |
AgentSet | getAgentsOfType (BWAPI::UnitType type, AgentSet &agentSet) |
Protected Attributes | |
AgentSet | agents |
TaskQueue | tasks |
Friends | |
class | Strategizer |
void Manager::addAgent | ( | Agent & | t | ) | [virtual] |
Definition at line 54 of file Manager.cpp.
Referenced by Strategizer::redistributeAgents().
{ agents.insert(&t); }
void Manager::addTask | ( | Task & | t | ) | [virtual] |
Definition at line 86 of file Manager.cpp.
{ tasks.push(&t); }
void Manager::doTask | ( | Task & | t | ) | [virtual] |
Definition at line 92 of file Manager.cpp.
{ }
void Manager::draw | ( | ) | [virtual] |
Reimplemented in BuildManager, CombatManager, SupplyManager, GasManager, and ResourceManager.
Definition at line 47 of file Manager.cpp.
Referenced by ResourceManager::draw(), CombatManager::draw(), and BuildManager::draw().
{ for (AgentSetIter agent = agents.begin(); agent != agents.end(); agent++) (*agent)->draw(); }
int Manager::estimateCost | ( | Task & | t | ) | [virtual] |
Definition at line 110 of file Manager.cpp.
{
return 0;
}
AgentSet Manager::getAgentsOfType | ( | BWAPI::UnitType | type | ) | [protected] |
AgentSet Manager::getAgentsOfType | ( | BWAPI::UnitType | type, |
AgentSet & | agentSet | ||
) | [protected] |
virtual const std::string& Manager::getName | ( | ) | const [inline, virtual] |
Reimplemented in BuildManager, GasManager, CombatManager, SupplyManager, ResourceManager, ProductionManager, ConstructionManager, and ScoutManager.
Definition at line 61 of file Manager.h.
Referenced by Agent::getParentManagerName().
{ static const std::string name("INVALID"); return name; }
int Manager::mwtpLast | ( | BWAPI::UnitType & | ut | ) | [virtual] |
Definition at line 104 of file Manager.cpp.
{
return 0;
}
int Manager::mwtpNext | ( | BWAPI::UnitType & | ut | ) | [virtual] |
Definition at line 98 of file Manager.cpp.
{
return 0;
}
int Manager::numAgents | ( | ) | const |
Definition at line 116 of file Manager.cpp.
Referenced by GasManager::draw().
{ return agents.size(); }
int Manager::numAgents | ( | BWAPI::UnitType | type | ) |
virtual void Manager::onMatchStart | ( | ) | [inline, virtual] |
Agent * Manager::removeAgent | ( | BWAPI::UnitType | ut | ) | [virtual] |
Definition at line 60 of file Manager.cpp.
{ Agent *agent = NULL; AgentSetIter it; for (it = agents.begin(); it != agents.end(); it++) { if ((*it)->getUnit().getType().getID() == ut.getID()) { agent = *it; agents.erase(agent); break; } } return agent; }
void Manager::removeAllAgents | ( | ) |
Definition at line 80 of file Manager.cpp.
{ agents.clear(); }
void Manager::update | ( | ) | [virtual] |
Reimplemented in BuildManager, CombatManager, SupplyManager, GasManager, ProductionManager, ResourceManager, ConstructionManager, and ScoutManager.
Definition at line 36 of file Manager.cpp.
References Agent::update().
Referenced by ConstructionManager::update(), ResourceManager::update(), ProductionManager::update(), CombatManager::update(), and BuildManager::update().
{ // Tell agents to update AgentSetIter agent; for (agent = agents.begin(); agent != agents.end(); agent++) { (*agent)->update(); } }
friend class Strategizer [friend] |
AgentSet Manager::agents [protected] |
Definition at line 17 of file Manager.h.
Referenced by GasManager::getNumWorkersGathering().
TaskQueue Manager::tasks [protected] |