BWAPI
|
#include <PFManager.h>
Public Member Functions | |
~PFManager () | |
void | computeAttackingUnitActions (BaseAgent *agent, TilePosition goal, bool defensive) |
void | computeAttackingUnitActions (BaseAgent *agent, TilePosition goal, bool defensive, bool forceMove) |
void | computeMedicUnitActions (BaseAgent *agent) |
bool | moveToGoal (BaseAgent *agent, TilePosition goal) |
Static Public Member Functions | |
static PFManager * | getInstance () |
In the bot unit navigation uses two techniques; if no enemy units are close units navigate using the built in pathfinder in Starcraft. If enemy units are close, own units uses potential fields to engage and surround the enemy. The PFManager class is the main class for the potential fields navigation system, and it shall be used compute and execute movement orders using potential fields.
The PFManager is implemented as a singleton class. Each class that needs to access PFManager can request an instance, and all classes shares the same PFManager instance.
Author: Johan Hagelback (johan.hagelback@gmail.com)
Destructor
void PFManager::computeAttackingUnitActions | ( | BaseAgent * | agent, |
TilePosition | goal, | ||
bool | defensive | ||
) |
Is used to compute and execute movement commands for attacking units using the potential field navigation system.
void PFManager::computeAttackingUnitActions | ( | BaseAgent * | agent, |
TilePosition | goal, | ||
bool | defensive, | ||
bool | forceMove | ||
) |
Is used to compute and execute movement commands for attacking units using the potential field navigation system. If forceMove is set to true, units always move even if they can attack.
void PFManager::computeMedicUnitActions | ( | BaseAgent * | agent | ) |
Is used to compute and execute movement commands for Medic units using the potential field navigation system.
PFManager * PFManager::getInstance | ( | ) | [static] |
Returns the instance to the class.
bool PFManager::moveToGoal | ( | BaseAgent * | agent, |
TilePosition | goal | ||
) |
Moves a unit to the specified goal using the pathfinder, and stops at a distance where the potential field navigation system should be used instead.