BWAPI
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
Manager Class Reference

#include <Manager.h>

Inheritance diagram for Manager:
Inheritance graph
[legend]
Collaboration diagram for Manager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void onMatchStart ()
virtual void update ()
virtual void draw ()
virtual void addAgent (Agent &t)
virtual AgentremoveAgent (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

Detailed Description

Definition at line 14 of file Manager.h.


Member Function Documentation

void Manager::addAgent ( Agent t) [virtual]

Definition at line 54 of file Manager.cpp.

Referenced by Strategizer::redistributeAgents().

{
        agents.insert(&t);
}

Here is the caller graph for this function:

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();
}

Here is the caller graph for this function:

int Manager::estimateCost ( Task t) [virtual]

Definition at line 110 of file Manager.cpp.

{
  return 0;
}
AgentSet Manager::getAgentsOfType ( BWAPI::UnitType  type) [protected]

Referenced by GasManager::update().

Here is the caller graph for this function:

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; 
    }

Here is the caller graph for this function:

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(); }

Here is the caller graph for this function:

int Manager::numAgents ( BWAPI::UnitType  type)
virtual void Manager::onMatchStart ( ) [inline, virtual]

Reimplemented in CombatManager.

Definition at line 29 of file Manager.h.

{ }
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;
}

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();
        }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class Strategizer [friend]

Definition at line 26 of file Manager.h.


Member Data Documentation

Definition at line 17 of file Manager.h.

Referenced by GasManager::getNumWorkersGathering().

Definition at line 18 of file Manager.h.


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