|
BWAPI
|
#include <ResourceManager.h>
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 ResourceManager * | getInstance () |
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)
Destructor.
| ResourceManager * ResourceManager::getInstance | ( | ) | [static] |
Returns the instance to the BuildPlanner that is currently used.

| bool ResourceManager::hasResources | ( | UnitType | type | ) |
Checks if we have enough resources free to build the specified unit.


| 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 | ( | 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.

1.7.6.1