BWAPI
|
#include <PFFunctions.h>
Static Public Member Functions | |
static float | getDistance (Position p1, Position p2) |
static float | getDistance (Position pos, Unit *unit) |
static float | calcOwnUnitP (float d, Unit *unit, Unit *otherOwnUnit) |
static float | calcAvoidWorkerP (float d, BaseAgent *unit, BaseAgent *oUnit) |
static float | calcMineP (float d, Unit *unit) |
static float | calcOwnUnitMedicP (float d, Unit *unit, Unit *otherOwnUnit) |
static float | calcNavigationP (float d) |
static float | getNavigationP (Position cPos, Position goal) |
static float | calcAttackingUnitP (float d, Unit *attacker, Unit *enemy, bool defensive) |
static float | calcDefensiveUnitP (float d, Unit *ownUnit, Unit *enemy) |
static bool | canAttack (Unit *ownUnit, Unit *target) |
Helper class for the PFManager. Contains methods to calculate the potentials generated by own units, enemy units and neutral objects in specific points.
Author: Johan Hagelback (johan.hagelback@gmail.com)
float PFFunctions::calcAttackingUnitP | ( | float | d, |
Unit * | attacker, | ||
Unit * | enemy, | ||
bool | defensive | ||
) | [static] |
Calculates the potential an attacking unit generates at distance d around an enemy unit.
float PFFunctions::calcAvoidWorkerP | ( | float | d, |
BaseAgent * | unit, | ||
BaseAgent * | oUnit | ||
) | [static] |
Calculates the potential own workers generate around themselves. Used to avoid collision at chokepoints.
float PFFunctions::calcDefensiveUnitP | ( | float | d, |
Unit * | ownUnit, | ||
Unit * | enemy | ||
) | [static] |
Calculates the potential a defensive unit generates at distance d around an enemy unit.
float PFFunctions::calcMineP | ( | float | d, |
Unit * | unit | ||
) | [static] |
Calculates the potential a Spider Mine generates around unit at distance d.
float PFFunctions::calcNavigationP | ( | float | d | ) | [static] |
Calculates the general potential field value at distance d used when moving towards a point.
float PFFunctions::calcOwnUnitMedicP | ( | float | d, |
Unit * | unit, | ||
Unit * | otherOwnUnit | ||
) | [static] |
Calculates the potential a Medic unit generates around otherOwnUnit at distance d.
float PFFunctions::calcOwnUnitP | ( | float | d, |
Unit * | unit, | ||
Unit * | otherOwnUnit | ||
) | [static] |
Calculates the potential otherOwnUnit generates around unit at distance d.
bool PFFunctions::canAttack | ( | Unit * | ownUnit, |
Unit * | target | ||
) | [static] |
Returns true if the own unit can attack the target.
float PFFunctions::getDistance | ( | Position | p1, |
Position | p2 | ||
) | [static] |
Returns the distance between two positions.
float PFFunctions::getDistance | ( | Position | pos, |
Unit * | unit | ||
) | [static] |
Returns the distance between a unit and a position.
float PFFunctions::getNavigationP | ( | Position | cPos, |
Position | goal | ||
) | [static] |
Returns the total potential for navigating from cPos to goal.