BWAPI
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
BuildPlanner Class Reference

#include <BuildPlanner.h>

List of all members.

Public Member Functions

 ~BuildPlanner ()
int noInProduction (UnitType type)
void computeActions ()
void buildingDestroyed (Unit *building)
void unlock (UnitType type)
void remove (UnitType type)
void handleWorkerDestroyed (UnitType type, int workerID)
void commandCenterBuilt ()
void printInfo ()
void handleNoBuildspotFound (UnitType toBuild)
bool shallBuildSupply ()
bool supplyBeingBuilt ()
bool nextIsOfType (UnitType type)
bool containsType (UnitType type)
void addBuilding (UnitType type)
void addBuildingFirst (UnitType type)
void expand (UnitType commandCenterUnit)
void addRefinery ()
bool executeMorph (UnitType target, UnitType evolved)

Static Public Member Functions

static BuildPlannergetInstance ()
static bool coveredByDetector (TilePosition pos)
static bool isTerran ()
static bool isProtoss ()
static bool isZerg ()

Protected Member Functions

 BuildPlanner ()
void lock (int buildOrderIndex, int unitId)
bool executeOrder (UnitType type)
bool shallBuildSupplyDepot ()
string format (UnitType type)
bool hasResourcesLeft ()
int mineralsNearby (TilePosition center)

Protected Attributes

vector< UnitTypebuildOrder
vector< BuildQueueItembuildQueue
int lastCommandCenter
int lastCallFrame

Detailed Description

The BuildPlanner class contains the build order for all buildings and addons that will be constructed during the course of a game. This class is not directly used, instead each race (Terran, Protoss, Zerg) has their own build order class that extends BuildPlanner.

The BuildPlanner is implemented as a singleton class. Each class that needs to access BuildPlanner can request an instance, and all classes shares the same BuildPlanner instance.

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


Constructor & Destructor Documentation

BuildPlanner::BuildPlanner ( ) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

Destructor.


Member Function Documentation

Adds a building to the buildorder queue.

Adds a building first in the buildorder queue.

Here is the caller graph for this function:

Adds a refinery to the buildorder list.

Here is the call graph for this function:

Here is the caller graph for this function:

void BuildPlanner::buildingDestroyed ( Unit building)

Notifies that an own unit has been destroyed.

Here is the call graph for this function:

Here is the caller graph for this function:

Sets that a new command center has been built.

Here is the call graph for this function:

Here is the caller graph for this function:

Called each update to issue orders.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if buildorder contains a unit of the specified type.

Here is the call graph for this function:

Here is the caller graph for this function:

Checks if the specified TilePosition is covered by a detector buildings sight radius.

Here is the call graph for this function:

bool BuildPlanner::executeMorph ( UnitType  target,
UnitType  evolved 
)

Morphs a Zerg drone to a building.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BuildPlanner::executeOrder ( UnitType  type) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

void BuildPlanner::expand ( UnitType  commandCenterUnit)

Requests to expand the base.

Here is the call graph for this function:

Here is the caller graph for this function:

string BuildPlanner::format ( UnitType  type) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the instance to the BuildPlanner that is currently used.

Here is the call graph for this function:

Here is the caller graph for this function:

Is called when no buildspot has been found for the specified type. Gives each buildplanner an opportunity to handle it.

Here is the call graph for this function:

Here is the caller graph for this function:

void BuildPlanner::handleWorkerDestroyed ( UnitType  type,
int  workerID 
)

Called when a worker that is constructing a building is destroyed.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BuildPlanner::hasResourcesLeft ( ) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

bool BuildPlanner::isProtoss ( ) [static]

Returns true if the player is Protoss.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BuildPlanner::isTerran ( ) [static]

Returns true if the player is Terran.

Here is the call graph for this function:

Here is the caller graph for this function:

bool BuildPlanner::isZerg ( ) [static]

Returns true if the player is Zerg.

Here is the call graph for this function:

Here is the caller graph for this function:

void BuildPlanner::lock ( int  buildOrderIndex,
int  unitId 
) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

int BuildPlanner::mineralsNearby ( TilePosition  center) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if next in buildorder is of the specified type. Returns false if buildorder is empty.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the number of units of the specified type currently being produced.

Here is the call graph for this function:

Here is the caller graph for this function:

Shows some debug info on screen.

Here is the call graph for this function:

Here is the caller graph for this function:

Removes a building from the buildorder.

Here is the call graph for this function:

Checks if more supply buildings are needed.

Here is the call graph for this function:

Here is the caller graph for this function:

Checks if a supply is under construction.

Here is the call graph for this function:

Here is the caller graph for this function:

When a request to construct a new building is issued, no construction are allowed until the worker has moved to the buildspot and started constructing the building. This is to avoid that the needed resources are not used up by other build orders. During this time the BuildPlanner is locked, and new construction can only be done when unlock has been called.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

vector<UnitType> BuildPlanner::buildOrder [protected]
int BuildPlanner::lastCallFrame [protected]

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