BWAPI
|
#include <AgentFactory.h>
Public Member Functions | |
~AgentFactory () | |
BaseAgent * | createAgent (Unit *unit) |
bool | isOfType (Unit *unit, UnitType type) |
Static Public Member Functions | |
static AgentFactory * | getInstance () |
The agent system is built from a single base agent where all specific agents extends the base agent indirectly or directly. The AgentFactory class is a factory that creates the correct BaseAgent instance for a specific unit. This class shall always be used when a new agent is requested.
The AgentFactory is implemented as a singleton class. Each class that needs to access AgentFactory can request an instance, and all classes shares the same AgentFactory instance.
Author: Johan Hagelback (johan.hagelback@gmail.com)
BaseAgent * AgentFactory::createAgent | ( | Unit * | unit | ) |
AgentFactory * AgentFactory::getInstance | ( | ) | [static] |
Returns the instance to the class.
bool AgentFactory::isOfType | ( | Unit * | unit, |
UnitType | type | ||
) |
Returns true if the unit is of the specified type.