BWAPI
|
#include <ExplorationManager.h>
The ExplorationManager handles all tasks involving exploration of the game world. It issue orders to a number of units that is used as explorers, keep track of areas recently explored, and keep track of spotted resources or enemy buildings.
The ExplorationManager is implemented as a singleton class. Each class that needs to access ExplorationManager can request an instance, and all classes shares the same ExplorationManager instance.
Author: Johan Hagelback (johan.hagelback@gmail.com)
Destructor
void ExplorationManager::addSpottedUnit | ( | Unit * | unit | ) |
Notifies about an enemy unit that has been spotted.
bool ExplorationManager::buildingsSpotted | ( | ) |
Returns true if any enemy buildings have been spotted.
bool ExplorationManager::canReach | ( | TilePosition | a, |
TilePosition | b | ||
) | [static] |
Returns true if a ground unit can reach position b from position a. Uses BWTA.
bool ExplorationManager::canReach | ( | BaseAgent * | agent, |
TilePosition | b | ||
) | [static] |
Returns true if an agent can reach position b.
void ExplorationManager::computeActions | ( | ) |
Called each update to issue orders.
bool ExplorationManager::enemyIsProtoss | ( | ) | [static] |
Returns true if an enemy is Protoss.
bool ExplorationManager::enemyIsTerran | ( | ) | [static] |
Returns true if an enemy is Terran.
bool ExplorationManager::enemyIsUnknown | ( | ) | [static] |
All enemy races are currently unknown.
bool ExplorationManager::enemyIsZerg | ( | ) | [static] |
Returns true if an enemy is Zerg.
Returns the closest enemy spotted building from a start position, or TilePosition(-1,-1) if none was found.
Returns the next position to expand the base to.
ExplorationManager * ExplorationManager::getInstance | ( | ) | [static] |
Returns the instance of the class.
Returns the next position to explore for this squad.
vector< SpottedObject * > ExplorationManager::getSpottedBuildings | ( | ) |
Returns the list of spotted enemy buildings.
bool ExplorationManager::isActive | ( | ) |
Returns true if the ExplorationManager is active, false if not.
bool ExplorationManager::isDetectorCovering | ( | TilePosition | pos | ) |
Checks if an enemy detector is covering the specified position.
bool ExplorationManager::isDetectorCovering | ( | Position | pos | ) |
Checks if an enemy detector is covering the specified position.
void ExplorationManager::printInfo | ( | ) |
Shows all spotted objects as squares on the SC map. Use for debug purpose.
Scans for vulnerable enemy bases, i.e. bases without protection from detectors.
Searches for the next position to expand the base to.
void ExplorationManager::setExpansionSite | ( | TilePosition | pos | ) |
Sets the next position to expand the base to.
void ExplorationManager::setExplored | ( | TilePosition | goal | ) |
Sets that a region is explored. The position must be the TilePosition for the center of the region.
void ExplorationManager::setInactive | ( | ) |
Sets ExplorationManager to inactive. Is used when perfect information is activated.
void ExplorationManager::showIntellData | ( | ) |
Shows some data about the enemy on screen.
int ExplorationManager::spottedBuildingsWithinRange | ( | TilePosition | pos, |
int | range | ||
) |
Calculates the number of spotted enemy buildings within the specified range (in tiles).
void ExplorationManager::unitDestroyed | ( | Unit * | unit | ) |
Notifies that an enemy unit has been destroyed. If the destroyed unit was among the spotted units, it is removed from the list.