BWAPI
Public Member Functions | Static Public Attributes
WorkerAgent Class Reference

#include <WorkerAgent.h>

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

List of all members.

Public Member Functions

 WorkerAgent (Unit *mUnit)
void computeActions ()
string getTypeName ()
void setState (int state)
int getState ()
bool canBuild (UnitType type)
bool assignToRepair (Unit *building)
bool assignToBuild (UnitType type)
bool assignToFinishBuild (Unit *building)
string getStateAsText ()
void destroyed ()
void reset ()
bool isConstructing (UnitType type)

Static Public Attributes

static const int GATHER_MINERALS = 0
static const int GATHER_GAS = 1
static const int FIND_BUILDSPOT = 2
static const int MOVE_TO_SPOT = 3
static const int CONSTRUCT = 4
static const int REPAIRING = 5
static const int ATTACKING = 6

Detailed Description

The WorkerAgent class handles all tasks that a worker, for example a Terran SCV, can perform. The tasks involves gathering minerals and gas, move to a selected buildspot and construct the specified building, and if Terran SCV, repair a building or tank.

Author: Johan Hagelback (johan.hagelback@gmail.com)


Constructor & Destructor Documentation

Constructor.

Here is the call graph for this function:


Member Function Documentation

bool WorkerAgent::assignToBuild ( UnitType  type) [virtual]

Assigns the unit to construct a building of the specified type.

Reimplemented from BaseAgent.

Here is the call graph for this function:

bool WorkerAgent::assignToFinishBuild ( Unit building) [virtual]

Assigns the agent to continue building a non-finished building.

Reimplemented from BaseAgent.

Here is the call graph for this function:

bool WorkerAgent::assignToRepair ( Unit building) [virtual]

Assigns the agent to repair a building or tank.

Reimplemented from BaseAgent.

Here is the call graph for this function:

bool WorkerAgent::canBuild ( UnitType  type) [virtual]

Returns true if the Worker agent can create units of the specified type.

Reimplemented from BaseAgent.

Here is the call graph for this function:

void WorkerAgent::computeActions ( ) [virtual]

Called each update to issue orders.

Reimplemented from BaseAgent.

Here is the call graph for this function:

void WorkerAgent::destroyed ( ) [virtual]

Called when the unit assigned to this agent is destroyed.

Reimplemented from BaseAgent.

Here is the call graph for this function:

Returns the current state of the worker.

Here is the caller graph for this function:

Returns the state of the agent as text. Good for printouts.

Here is the caller graph for this function:

string WorkerAgent::getTypeName ( ) [virtual]

Returns the unique type name for worker agents.

Reimplemented from BaseAgent.

Returns true if this worker is in any of the build states, and is constructing the specified building.

Here is the call graph for this function:

Resets a worker to gathering minerals.

Here is the call graph for this function:

Here is the caller graph for this function:

void WorkerAgent::setState ( int  state)

Set the state of the worker. I.e. what does it do right now. Should only be set if the worker is getting a task not through the functions in this class. Then it is automatic.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

const int WorkerAgent::ATTACKING = 6 [static]

Worker is needed to attack an enemy intruder in a base.

const int WorkerAgent::CONSTRUCT = 4 [static]

Worker is constructing a building.

const int WorkerAgent::FIND_BUILDSPOT = 2 [static]

Worker is trying to find a buildspot for a requested building.

const int WorkerAgent::GATHER_GAS = 1 [static]

Worker is gathering gas.

const int WorkerAgent::GATHER_MINERALS = 0 [static]

Worker is gathering minerals.

const int WorkerAgent::MOVE_TO_SPOT = 3 [static]

Worker is moving to a found buildspot.

const int WorkerAgent::REPAIRING = 5 [static]

Worker is repairing a building (Terran only).


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