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

#include <ResourceManager.h>

List of all members.

Public Member Functions

 ~ResourceManager ()
bool needWorker ()
bool hasResources (UnitType type)
bool hasResources (UpgradeType type)
bool hasResources (TechType type)
bool hasResources (int neededMinerals, int neededGas)
void lockResources (UnitType type)
void unlockResources (UnitType type)
void printInfo ()

Static Public Member Functions

static ResourceManagergetInstance ()

Detailed Description

ResourceManager handles the resources and where to spend them. An agent must ask the ResourceManager for permission to build/upgrade/research before issuing the order.

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

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


Constructor & Destructor Documentation

ResourceManager::~ResourceManager ( )

Destructor.


Member Function Documentation

ResourceManager * ResourceManager::getInstance ( ) [static]

Returns the instance to the BuildPlanner that is currently used.

bool ResourceManager::hasResources ( UpgradeType  type)

Checks if we have enough resources free for the specified upgrade.

bool ResourceManager::hasResources ( TechType  type)

Checks if we have enough resources free for the specified research.

bool ResourceManager::hasResources ( UnitType  type)

Checks if we have enough resources free to build the specified unit.

bool ResourceManager::hasResources ( int  neededMinerals,
int  neededGas 
)

Checks if we have enough resources free.

void ResourceManager::lockResources ( UnitType  type)

Locks resources for use.

bool ResourceManager::needWorker ( )

Checks if we need to construct a new worker.

void ResourceManager::printInfo ( )

Shows some debug info on screen.

void ResourceManager::unlockResources ( UnitType  type)

Unlocks resources for use.


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