TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
Updates and organizes information about all the units in the game. More...
#include <unitsinfo.h>
Public Types | |
typedef std::vector< Unit * > | Units |
Public Member Functions | |
UnitsInfo (State *state_) | |
~UnitsInfo () | |
UnitsInfo (UnitsInfo const &)=delete | |
UnitsInfo & | operator= (UnitsInfo const &)=delete |
Unit * | getUnit (UnitId id) |
const Units & | myUnitsOfType (const BuildType *type) |
Our units of a particular type (does not include dead units). More... | |
const Units & | myCompletedUnitsOfType (const BuildType *type) |
Our completed units of a particular type (does not include dead units). More... | |
const Units & | allUnitsEver () |
All units we've ever seen. More... | |
const Units & | liveUnits () |
All units that are not dead. This includes gone units. More... | |
const Units & | visibleUnits () |
All units that are currently visible. More... | |
const Units & | hiddenUnits () |
All units that are currently not visible. More... | |
const Units & | visibleBuildings () |
All buildings that are currently visible. More... | |
const Units & | resourceUnits () |
All resources (mineral fields, gas geysers + refineries) More... | |
const Units & | myUnits () |
All our (live) units. More... | |
const Units & | myWorkers () |
const Units & | myBuildings () |
const Units & | myResourceDepots () |
const Units & | enemyUnits () |
All enemy units that are not dead (includes gone units). More... | |
const Units & | visibleEnemyUnits () |
All enemy units that we can see right now. More... | |
const Units & | neutralUnits () |
All neutral units that are not dead. More... | |
const Units & | getNewUnits () |
All units that were discovered since the previous update/step. More... | |
const Units & | getStartedMorphingUnits () |
All units that has started morphing to a different unit type (was not morphing last update/step). More... | |
const Units & | getCompletedOrMorphedUnits () |
All units that finished being built or finished morphing since the previous update/step. More... | |
const Units & | getShowUnits () |
All units that went from hidden to visible since the previous update/step. More... | |
const Units & | getHideUnits () |
All units that went from visible to hidden since the previous update/step. More... | |
const Units & | getDestroyUnits () |
All units that died since the previous update/step. More... | |
const Units & | mapHacked () |
Parse the units directly from the tcstate, this is only reasonable when we have mapHack on. More... | |
const std::unordered_map< const BuildType *, int > & | inferredEnemyUnitTypes () |
void | update () |
Protected Member Functions | |
void | updateUnit (Unit *, const tc::Unit &, tc::State *, bool maphack=false) |
void | updateGroups (Unit *i) |
size_t | inferPositionsUnitAtIndex (Position pos) |
Position | inferMovePosition (Position source, bool flying, int tileVisibiltyAge) |
void | inferMoveUnit (Unit *u, Position newPos) |
void | inferUpdateNearbyUnits () |
Updates and organizes information about all the units in the game.
typedef std::vector<Unit*> cherrypi::UnitsInfo::Units |
cherrypi::UnitsInfo::UnitsInfo | ( | State * | state_ | ) |
cherrypi::UnitsInfo::~UnitsInfo | ( | ) |
|
delete |
|
inline |
All units we've ever seen.
|
inline |
All enemy units that are not dead (includes gone units).
|
inline |
All units that finished being built or finished morphing since the previous update/step.
|
inline |
All units that died since the previous update/step.
|
inline |
All units that went from visible to hidden since the previous update/step.
|
inline |
All units that were discovered since the previous update/step.
|
inline |
All units that went from hidden to visible since the previous update/step.
|
inline |
All units that has started morphing to a different unit type (was not morphing last update/step).
|
inline |
All units that are currently not visible.
|
protected |
|
protected |
const std::unordered_map< const BuildType *, int > & cherrypi::UnitsInfo::inferredEnemyUnitTypes | ( | ) |
|
protected |
|
inline |
All units that are not dead. This includes gone units.
const UnitsInfo::Units & cherrypi::UnitsInfo::mapHacked | ( | ) |
Parse the units directly from the tcstate, this is only reasonable when we have mapHack on.
Keep in mind not all things that we precompute, like beingAttackedByEnemies, etc, are filled out in the mapHacked units.
|
inline |
const UnitsInfo::Units & cherrypi::UnitsInfo::myCompletedUnitsOfType | ( | const BuildType * | type | ) |
Our completed units of a particular type (does not include dead units).
|
inline |
|
inline |
All our (live) units.
const UnitsInfo::Units & cherrypi::UnitsInfo::myUnitsOfType | ( | const BuildType * | type | ) |
Our units of a particular type (does not include dead units).
|
inline |
|
inline |
All neutral units that are not dead.
|
inline |
All resources (mineral fields, gas geysers + refineries)
void cherrypi::UnitsInfo::update | ( | ) |
|
protected |
|
protected |
|
inline |
All buildings that are currently visible.
|
inline |
All enemy units that we can see right now.
|
inline |
All units that are currently visible.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |