BTHAI 2.3
Public Member Functions | Static Public Member Functions
AgentFactory Class Reference

#include <AgentFactory.h>

List of all members.

Public Member Functions

BaseAgentcreateAgent (Unit *unit)
bool isOfType (Unit *unit, UnitType type)

Static Public Member Functions

static AgentFactorygetInstance ()

Detailed Description

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)


Member Function Documentation

BaseAgent * AgentFactory::createAgent ( Unit *  unit)

Creates the BaseAgent

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.


The documentation for this class was generated from the following files:
 All Classes Functions Variables