#include <GameImpl.h>
Public Member Functions | |
Event | makeEvent (BWAPIC::Event e) |
int | addUnitCommand (BWAPIC::UnitCommand &c) |
GameImpl (GameData *data) | |
void | onMatchStart () |
void | onMatchEnd () |
void | onMatchFrame () |
const GameData * | getGameData () const |
virtual std::set< Force * > & | getForces () |
virtual std::set< Player * > & | getPlayers () |
virtual std::set< Unit * > & | getAllUnits () |
virtual std::set< Unit * > & | getMinerals () |
virtual std::set< Unit * > & | getGeysers () |
virtual std::set< Unit * > & | getNeutralUnits () |
virtual std::set< Unit * > & | getStaticMinerals () |
virtual std::set< Unit * > & | getStaticGeysers () |
virtual std::set< Unit * > & | getStaticNeutralUnits () |
virtual std::set< Bullet * > & | getBullets () |
virtual std::set< Position > & | getNukeDots () |
virtual std::list< Event > & | getEvents () |
virtual Force * | getForce (int forceID) |
virtual Player * | getPlayer (int playerID) |
virtual Unit * | getUnit (int unitID) |
virtual Unit * | indexToUnit (int unitIndex) |
virtual GameType | getGameType () |
virtual int | getLatency () |
virtual int | getFrameCount () |
virtual int | getFPS () |
virtual double | getAverageFPS () |
virtual BWAPI::Position | getMousePosition () |
virtual bool | getMouseState (MouseButton button) |
virtual bool | getMouseState (int button) |
virtual bool | getKeyState (Key key) |
virtual bool | getKeyState (int key) |
virtual BWAPI::Position | getScreenPosition () |
virtual void | setScreenPosition (int x, int y) |
virtual void | setScreenPosition (BWAPI::Position p) |
virtual void | pingMinimap (int x, int y) |
virtual void | pingMinimap (BWAPI::Position p) |
virtual bool | isFlagEnabled (int flag) |
virtual void | enableFlag (int flag) |
virtual std::set< Unit * > & | getUnitsOnTile (int x, int y) |
virtual std::set< Unit * > & | getUnitsInRectangle (int left, int top, int right, int bottom) const |
virtual std::set< Unit * > & | getUnitsInRectangle (BWAPI::Position topLeft, BWAPI::Position bottomRight) const |
virtual std::set< Unit * > & | getUnitsInRadius (BWAPI::Position center, int radius) const |
virtual Error | getLastError () const |
virtual bool | setLastError (BWAPI::Error e) |
virtual int | mapWidth () |
virtual int | mapHeight () |
virtual std::string | mapFileName () |
virtual std::string | mapPathName () |
virtual std::string | mapName () |
virtual std::string | mapHash () |
virtual bool | isWalkable (int x, int y) |
virtual int | getGroundHeight (int x, int y) |
virtual int | getGroundHeight (TilePosition position) |
virtual bool | isBuildable (int x, int y, bool includeBuildings=false) |
virtual bool | isBuildable (TilePosition position, bool includeBuildings=false) |
virtual bool | isVisible (int x, int y) |
virtual bool | isVisible (TilePosition position) |
virtual bool | isExplored (int x, int y) |
virtual bool | isExplored (TilePosition position) |
virtual bool | hasCreep (int x, int y) |
virtual bool | hasCreep (TilePosition position) |
virtual bool | hasPower (int tileX, int tileY, UnitType unitType=UnitTypes::None) const |
virtual bool | hasPower (TilePosition position, UnitType unitType=UnitTypes::None) const |
virtual bool | hasPower (int tileX, int tileY, int tileWidth, int tileHeight, UnitType unitType=UnitTypes::None) const |
virtual bool | hasPower (TilePosition position, int tileWidth, int tileHeight, UnitType unitType=UnitTypes::None) const |
virtual bool | hasPowerPrecise (int x, int y, UnitType unitType=UnitTypes::None) const |
virtual bool | hasPowerPrecise (Position position, UnitType unitType=UnitTypes::None) const |
virtual bool | canBuildHere (const Unit *builder, TilePosition position, UnitType type, bool checkExplored=false) |
virtual bool | canMake (const Unit *builder, UnitType type) |
virtual bool | canResearch (const Unit *unit, TechType type) |
virtual bool | canUpgrade (const Unit *unit, UpgradeType type) |
virtual std::set< TilePosition > & | getStartLocations () |
virtual void | printf (const char *format,...) |
virtual void | sendText (const char *format,...) |
virtual void | sendTextEx (bool toAllies, const char *format,...) |
virtual void | changeRace (BWAPI::Race race) |
virtual bool | isInGame () |
virtual bool | isMultiplayer () |
virtual bool | isBattleNet () |
virtual bool | isPaused () |
virtual bool | isReplay () |
virtual void | startGame () |
virtual void | pauseGame () |
virtual void | resumeGame () |
virtual void | leaveGame () |
virtual void | restartGame () |
virtual void | setLocalSpeed (int speed=-1) |
virtual bool | issueCommand (const std::set< BWAPI::Unit * > &units, UnitCommand command) |
virtual std::set< BWAPI::Unit * > & | getSelectedUnits () |
virtual Player * | self () |
virtual Player * | enemy () |
virtual Player * | neutral () |
virtual std::set < BWAPI::Player * > & | allies () |
virtual std::set < BWAPI::Player * > & | enemies () |
virtual std::set < BWAPI::Player * > & | observers () |
virtual void | setTextSize (int size=1) |
virtual void | drawText (int ctype, int x, int y, const char *format,...) |
virtual void | drawTextMap (int x, int y, const char *format,...) |
virtual void | drawTextMouse (int x, int y, const char *format,...) |
virtual void | drawTextScreen (int x, int y, const char *format,...) |
virtual void | drawBox (int ctype, int left, int top, int right, int bottom, Color color, bool isSolid=false) |
virtual void | drawBoxMap (int left, int top, int right, int bottom, Color color, bool isSolid=false) |
virtual void | drawBoxMouse (int left, int top, int right, int bottom, Color color, bool isSolid=false) |
virtual void | drawBoxScreen (int left, int top, int right, int bottom, Color color, bool isSolid=false) |
virtual void | drawTriangle (int ctype, int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid=false) |
virtual void | drawTriangleMap (int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid=false) |
virtual void | drawTriangleMouse (int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid=false) |
virtual void | drawTriangleScreen (int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid=false) |
virtual void | drawCircle (int ctype, int x, int y, int radius, Color color, bool isSolid=false) |
virtual void | drawCircleMap (int x, int y, int radius, Color color, bool isSolid=false) |
virtual void | drawCircleMouse (int x, int y, int radius, Color color, bool isSolid=false) |
virtual void | drawCircleScreen (int x, int y, int radius, Color color, bool isSolid=false) |
virtual void | drawEllipse (int ctype, int x, int y, int xrad, int yrad, Color color, bool isSolid=false) |
virtual void | drawEllipseMap (int x, int y, int xrad, int yrad, Color color, bool isSolid=false) |
virtual void | drawEllipseMouse (int x, int y, int xrad, int yrad, Color color, bool isSolid=false) |
virtual void | drawEllipseScreen (int x, int y, int xrad, int yrad, Color color, bool isSolid=false) |
virtual void | drawDot (int ctype, int x, int y, Color color) |
virtual void | drawDotMap (int x, int y, Color color) |
virtual void | drawDotMouse (int x, int y, Color color) |
virtual void | drawDotScreen (int x, int y, Color color) |
virtual void | drawLine (int ctype, int x1, int y1, int x2, int y2, Color color) |
virtual void | drawLineMap (int x1, int y1, int x2, int y2, Color color) |
virtual void | drawLineMouse (int x1, int y1, int x2, int y2, Color color) |
virtual void | drawLineScreen (int x1, int y1, int x2, int y2, Color color) |
virtual void * | getScreenBuffer () |
virtual int | getLatencyFrames () |
virtual int | getLatencyTime () |
virtual int | getRemainingLatencyFrames () |
virtual int | getRemainingLatencyTime () |
virtual int | getRevision () |
virtual bool | isDebug () |
virtual bool | isLatComEnabled () |
virtual void | setLatCom (bool isEnabled) |
virtual int | getReplayFrameCount () |
virtual void | setGUI (bool enabled=true) |
virtual int | getInstanceNumber () |
virtual int | getAPM (bool includeSelects=false) |
virtual bool | setMap (const char *mapFileName) |
virtual void | setFrameSkip (int frameSkip=1) |
virtual bool | hasPath (Position source, Position destination) const |
virtual bool | setAlliance (BWAPI::Player *player, bool allied=true, bool alliedVictory=true) |
virtual bool | setVision (BWAPI::Player *player, bool enabled=true) |
virtual int | elapsedTime () const |
virtual void | setCommandOptimizationLevel (int level=2) |
Public Attributes | |
bool | inGame |
BWAPI::GameImpl::GameImpl | ( | GameData * | data | ) |
virtual std::set<BWAPI::Player*>& BWAPI::GameImpl::allies | ( | ) | [virtual] |
Returns a set of all the ally players that have not left or been defeated. Does not include self.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::canBuildHere | ( | const Unit * | builder, |
TilePosition | position, | ||
UnitType | type, | ||
bool | checkExplored = false |
||
) | [virtual] |
Returns true if the given unit type can be built at the given build tile position. Note the tile position specifies the top left tile of the building. If builder is not null, the unit will be discarded when determining whether or not any ground units are blocking the build location.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::canMake | ( | const Unit * | builder, |
UnitType | type | ||
) | [virtual] |
Returns true if the AI player has enough resources, supply, tech, and required units in order to make the given unit type. If builder is not null, canMake will return true only if the builder unit can build the given unit type.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::canResearch | ( | const Unit * | unit, |
TechType | type | ||
) | [virtual] |
Returns true if the AI player has enough resources required to research the given tech type. If unit is not null, canResearch will return true only if the given unit can research the given tech type.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::canUpgrade | ( | const Unit * | unit, |
UpgradeType | type | ||
) | [virtual] |
Returns true if the AI player has enough resources required to upgrade the given upgrade type. If unit is not null, canUpgrade will return true only if the given unit can upgrade the given upgrade type.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::changeRace | ( | BWAPI::Race | race | ) | [virtual] |
Used to change the race while in a lobby. Note that there is no onLobbyEnter callback yet, so this function cannot be used at this time.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawBox | ( | int | ctype, |
int | left, | ||
int | top, | ||
int | right, | ||
int | bottom, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Draws a box on the screen, with the given color. If isSolid is true, the entire box will be rendered, otherwise just the outline will be drawn.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawBoxMap | ( | int | left, |
int | top, | ||
int | right, | ||
int | bottom, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawBoxMouse | ( | int | left, |
int | top, | ||
int | right, | ||
int | bottom, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawBoxScreen | ( | int | left, |
int | top, | ||
int | right, | ||
int | bottom, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawCircle | ( | int | ctype, |
int | x, | ||
int | y, | ||
int | radius, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Draws a circle on the screen, with the given color. If isSolid is true, a solid circle is drawn, otherwise just the outline of a circle will be drawn.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawCircleMap | ( | int | x, |
int | y, | ||
int | radius, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawCircleMouse | ( | int | x, |
int | y, | ||
int | radius, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawCircleScreen | ( | int | x, |
int | y, | ||
int | radius, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawDot | ( | int | ctype, |
int | x, | ||
int | y, | ||
Color | color | ||
) | [virtual] |
Draws a dot on the screen at the given position with the given color.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawDotMap | ( | int | x, |
int | y, | ||
Color | color | ||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawDotMouse | ( | int | x, |
int | y, | ||
Color | color | ||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawDotScreen | ( | int | x, |
int | y, | ||
Color | color | ||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawEllipse | ( | int | ctype, |
int | x, | ||
int | y, | ||
int | xrad, | ||
int | yrad, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Draws an ellipse on the screen, with the given color. If isSolid is true, a solid ellipse is drawn, otherwise just the outline of an ellipse will be drawn.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawEllipseMap | ( | int | x, |
int | y, | ||
int | xrad, | ||
int | yrad, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawEllipseMouse | ( | int | x, |
int | y, | ||
int | xrad, | ||
int | yrad, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawEllipseScreen | ( | int | x, |
int | y, | ||
int | xrad, | ||
int | yrad, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawLine | ( | int | ctype, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
Color | color | ||
) | [virtual] |
Draws a line on the screen from (x1,y1) to (x2,y2) with the given color.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawLineMap | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
Color | color | ||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawLineMouse | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
Color | color | ||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawLineScreen | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
Color | color | ||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawText | ( | int | ctype, |
int | x, | ||
int | y, | ||
const char * | format, | ||
... | |||
) | [virtual] |
Draws text on the screen at the given position. Text can be drawn in different colors by using the following control characters: TODO: add image from wiki.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawTextMap | ( | int | x, |
int | y, | ||
const char * | format, | ||
... | |||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawTextMouse | ( | int | x, |
int | y, | ||
const char * | format, | ||
... | |||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawTextScreen | ( | int | x, |
int | y, | ||
const char * | format, | ||
... | |||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawTriangle | ( | int | ctype, |
int | ax, | ||
int | ay, | ||
int | bx, | ||
int | by, | ||
int | cx, | ||
int | cy, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Draws a triangle on the screen. If isSolid is true, a solid triangle is drawn, otherwise just the outline of the triangle will be drawn.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawTriangleMap | ( | int | ax, |
int | ay, | ||
int | bx, | ||
int | by, | ||
int | cx, | ||
int | cy, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawTriangleMouse | ( | int | ax, |
int | ay, | ||
int | bx, | ||
int | by, | ||
int | cx, | ||
int | cy, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::drawTriangleScreen | ( | int | ax, |
int | ay, | ||
int | bx, | ||
int | by, | ||
int | cx, | ||
int | cy, | ||
Color | color, | ||
bool | isSolid = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::elapsedTime | ( | ) | const [virtual] |
Returns the elapsed game time in seconds.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::enableFlag | ( | int | flag | ) | [virtual] |
Enables the specified flag. Note that flags can only be enabled at the beginning of a match, during the AIModule::onStart callback.
Implements BWAPI::Game.
virtual std::set<BWAPI::Player*>& BWAPI::GameImpl::enemies | ( | ) | [virtual] |
Returns a set of all the enemy players that have not left or been defeated.
Implements BWAPI::Game.
virtual Player* BWAPI::GameImpl::enemy | ( | ) | [virtual] |
Returns a pointer to the enemy player. If there is more than one enemy, this returns a pointer to just one enemy (see enemies to get all enemies still in game). In replays this will return NULL.
Implements BWAPI::Game.
virtual std::set< Unit* >& BWAPI::GameImpl::getAllUnits | ( | ) | [virtual] |
Returns all the visible units. If Flag::CompleteMapInformation is enabled, the set of all units is returned, not just visible ones. Note that units inside refineries are not included in this set yet.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getAPM | ( | bool | includeSelects = false | ) | [virtual] |
Retrieves the bot's APM. Can include or exclude select commands.
Implements BWAPI::Game.
virtual double BWAPI::GameImpl::getAverageFPS | ( | ) | [virtual] |
Implements BWAPI::Game.
virtual std::set< Bullet* >& BWAPI::GameImpl::getBullets | ( | ) | [virtual] |
Returns all visible bullets. If Flag::CompleteMapInformation is enabled, the set of all bullets is returned, not just visible ones.
Implements BWAPI::Game.
virtual std::list< Event>& BWAPI::GameImpl::getEvents | ( | ) | [virtual] |
Returns the list of events
Implements BWAPI::Game.
virtual Force* BWAPI::GameImpl::getForce | ( | int | forceID | ) | [virtual] |
Returns the force with the given ID, or NULL if no force has the given ID
Implements BWAPI::Game.
virtual std::set< Force* >& BWAPI::GameImpl::getForces | ( | ) | [virtual] |
Returns the set of all forces in the match.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getFPS | ( | ) | [virtual] |
Returns the Frames Per Second (FPS) that the game is currently running at
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getFrameCount | ( | ) | [virtual] |
Returns the number of logical frames since the match started. If the game is paused, Game::getFrameCount will not increase however AIModule::onFrame will still be called while paused. On Fastest, there are about 23.8 - 24 frames per second.
Implements BWAPI::Game.
const GameData* BWAPI::GameImpl::getGameData | ( | ) | const |
virtual GameType BWAPI::GameImpl::getGameType | ( | ) | [virtual] |
Returns the game type
Implements BWAPI::Game.
virtual std::set< Unit* >& BWAPI::GameImpl::getGeysers | ( | ) | [virtual] |
Returns the set of all accessible vespene geysers.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getGroundHeight | ( | int | tileX, |
int | tileY | ||
) | [virtual] |
Returns the ground height of the given build tile. 0 = normal, 1 = high ground. 2 = very high ground.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getGroundHeight | ( | TilePosition | position | ) | [virtual] |
Returns the ground height of the given build tile. 0 = normal, 1 = high ground. 2 = very high ground.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getInstanceNumber | ( | ) | [virtual] |
Retrieves the instance number recorded by BWAPI to identify which instance an AI module belongs to
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::getKeyState | ( | Key | key | ) | [virtual] |
Returns true if the specified key is pressed. Returns false if Flag::UserInput is disabled. Unfortunately this does not read the raw keyboard input yet - when you hold down a key, the getKeyState function is true for a frame, then false for a few frames, and then alternates between true and false (as if you were holding down the key in a text box). Hopefully this will be fixed in a later version.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::getKeyState | ( | int | key | ) | [virtual] |
Returns true if the specified key is pressed. Returns false if Flag::UserInput is disabled. Unfortunately this does not read the raw keyboard input yet - when you hold down a key, the getKeyState function is true for a frame, then false for a few frames, and then alternates between true and false (as if you were holding down the key in a text box). Hopefully this will be fixed in a later version.
Implements BWAPI::Game.
virtual Error BWAPI::GameImpl::getLastError | ( | ) | const [virtual] |
Returns the last error that was set. If you try to order enemy units around, or morph bunkers into lurkers, BWAPI will set error codes, which can be retrieved using this function.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getLatency | ( | ) | [virtual] |
Returns the amount of latency the current game has. Currently only returns Latency::SinglePlayer, Latency::LanLow, Latency::LanMedium, or Latency::LanHigh.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getLatencyFrames | ( | ) | [virtual] |
Retrieves latency values for the game. Includes latency, speed, and mode
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getLatencyTime | ( | ) | [virtual] |
Implements BWAPI::Game.
virtual std::set< Unit* >& BWAPI::GameImpl::getMinerals | ( | ) | [virtual] |
Returns the set of all accessible mineral patches.
Implements BWAPI::Game.
virtual BWAPI::Position BWAPI::GameImpl::getMousePosition | ( | ) | [virtual] |
Returns the position of the mouse on the screen. Returns Positions::Unknown if Flag::UserInput is disabled.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::getMouseState | ( | MouseButton | button | ) | [virtual] |
Returns true if the specified mouse button is pressed. Returns false if Flag::UserInput is disabled.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::getMouseState | ( | int | button | ) | [virtual] |
Returns true if the specified mouse button is pressed. Returns false if Flag::UserInput is disabled.
Implements BWAPI::Game.
virtual std::set< Unit* >& BWAPI::GameImpl::getNeutralUnits | ( | ) | [virtual] |
Returns the set of all accessible neutral units.
Implements BWAPI::Game.
virtual std::set< Position >& BWAPI::GameImpl::getNukeDots | ( | ) | [virtual] |
Returns all visible nuke dots. If Flag::CompleteMapInformation is enabled, the set of all nuke dots is returned, not just visible ones.
Implements BWAPI::Game.
virtual Player* BWAPI::GameImpl::getPlayer | ( | int | playerID | ) | [virtual] |
Returns the player with the given ID, or NULL if no player has the given ID
Implements BWAPI::Game.
virtual std::set< Player* >& BWAPI::GameImpl::getPlayers | ( | ) | [virtual] |
Returns the set of all players in the match. Note that this includes the Neutral player, which owns all the neutral units such as minerals, critters, etc.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getRemainingLatencyFrames | ( | ) | [virtual] |
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getRemainingLatencyTime | ( | ) | [virtual] |
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getReplayFrameCount | ( | ) | [virtual] |
Retrieves the number of frames in the replay
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::getRevision | ( | ) | [virtual] |
Retrieves the current revision of BWAPI.
Implements BWAPI::Game.
virtual void* BWAPI::GameImpl::getScreenBuffer | ( | ) | [virtual] |
Retrieves the screen buffer for the game (excluding the HUD)
Implements BWAPI::Game.
virtual BWAPI::Position BWAPI::GameImpl::getScreenPosition | ( | ) | [virtual] |
Returns the position of the top left corner of the screen on the map. Returns Positions::Unknown if Flag::UserInput is disabled.
Implements BWAPI::Game.
virtual std::set<BWAPI::Unit*>& BWAPI::GameImpl::getSelectedUnits | ( | ) | [virtual] |
Returns the set of units currently selected by the user in the GUI. If Flag?::UserInput? was not enabled during the AIModule::onStart callback, this function will always return an empty set.
Implements BWAPI::Game.
virtual std::set< TilePosition >& BWAPI::GameImpl::getStartLocations | ( | ) | [virtual] |
Returns the set of starting locations for the given map. To determine the starting location for the players in the current match, see Player::getStartLocation.
Implements BWAPI::Game.
virtual std::set< Unit* >& BWAPI::GameImpl::getStaticGeysers | ( | ) | [virtual] |
Returns the set of all vespene geysers (including mined out and other inaccessible ones).
Implements BWAPI::Game.
virtual std::set< Unit* >& BWAPI::GameImpl::getStaticMinerals | ( | ) | [virtual] |
Returns the set of all mineral patches (including mined out and other inaccessible ones).
Implements BWAPI::Game.
virtual std::set< Unit* >& BWAPI::GameImpl::getStaticNeutralUnits | ( | ) | [virtual] |
Returns the set of all neutral units (including mined out and other inaccessible ones).
Implements BWAPI::Game.
virtual Unit* BWAPI::GameImpl::getUnit | ( | int | unitID | ) | [virtual] |
Returns the unit with the given ID, or NULL if no unit has the given ID
Implements BWAPI::Game.
virtual std::set<Unit*>& BWAPI::GameImpl::getUnitsInRadius | ( | BWAPI::Position | center, |
int | radius | ||
) | const [virtual] |
Returns the set of accessible units within or overlapping a circle at the given point with the given radius.
Implements BWAPI::Game.
virtual std::set<Unit*>& BWAPI::GameImpl::getUnitsInRectangle | ( | int | left, |
int | top, | ||
int | right, | ||
int | bottom | ||
) | const [virtual] |
Returns the set of accessible units that are in or overlapping the given rectangle.
Implements BWAPI::Game.
virtual std::set<Unit*>& BWAPI::GameImpl::getUnitsInRectangle | ( | BWAPI::Position | topLeft, |
BWAPI::Position | bottomRight | ||
) | const [virtual] |
Implements BWAPI::Game.
virtual std::set<Unit*>& BWAPI::GameImpl::getUnitsOnTile | ( | int | tileX, |
int | tileY | ||
) | [virtual] |
Returns the set of accessible units that are on the given build tile.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasCreep | ( | int | tileX, |
int | tileY | ||
) | [virtual] |
Returns true if the specified build tile has zerg creep on it. If the tile is concealed by fog of war, the function will return false.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasCreep | ( | TilePosition | position | ) | [virtual] |
Returns true if the specified build tile has zerg creep on it. If the tile is concealed by fog of war, the function will return false.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasPath | ( | Position | source, |
Position | destination | ||
) | const [virtual] |
Returns true if Starcraft can find a path from the source to the destination.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasPower | ( | int | tileX, |
int | tileY, | ||
UnitType | unitType = UnitTypes::None |
||
) | const [virtual] |
Returns true if the given build location is powered by a nearby friendly pylon.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasPower | ( | TilePosition | position, |
UnitType | unitType = UnitTypes::None |
||
) | const [virtual] |
Returns true if the given build location is powered by a nearby friendly pylon.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasPower | ( | int | tileX, |
int | tileY, | ||
int | tileWidth, | ||
int | tileHeight, | ||
UnitType | unitType = UnitTypes::None |
||
) | const [virtual] |
Returns true if the given build location is powered by a nearby friendly pylon.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasPower | ( | TilePosition | position, |
int | tileWidth, | ||
int | tileHeight, | ||
UnitType | unitType = UnitTypes::None |
||
) | const [virtual] |
Returns true if the given build location is powered by a nearby friendly pylon.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasPowerPrecise | ( | int | x, |
int | y, | ||
UnitType | unitType = UnitTypes::None |
||
) | const [virtual] |
Returns true if the given pixel location is powered by a nearby friendly pylon.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::hasPowerPrecise | ( | Position | position, |
UnitType | unitType = UnitTypes::None |
||
) | const [virtual] |
Returns true if the given pixel location is powered by a nearby friendly pylon.
Implements BWAPI::Game.
virtual Unit* BWAPI::GameImpl::indexToUnit | ( | int | unitIndex | ) | [virtual] |
Returns a pointer to a Unit given an index.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isBattleNet | ( | ) | [virtual] |
Returns true if Broodwar is in a BNet multiplayer game.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isBuildable | ( | int | tileX, |
int | tileY, | ||
bool | includeBuildings = false |
||
) | [virtual] |
Returns true if the specified build tile is buildable. Note that this just uses the static map data. You will also need to make sure no ground units on the tile to see if its currently buildable. To do this, see unitsOnTile.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isBuildable | ( | TilePosition | position, |
bool | includeBuildings = false |
||
) | [virtual] |
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isDebug | ( | ) | [virtual] |
Retrieves the debug state of the BWAPI build.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isExplored | ( | int | tileX, |
int | tileY | ||
) | [virtual] |
Returns true if the specified build tile has been explored (i.e. was visible at some point in the match).
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isExplored | ( | TilePosition | position | ) | [virtual] |
Returns true if the specified build tile has been explored (i.e. was visible at some point in the match).
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isFlagEnabled | ( | int | flag | ) | [virtual] |
Returns true if the given flag has been enabled. Note that flags can only be enabled at the beginning of a match, during the AIModule::onStart callback.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isInGame | ( | ) | [virtual] |
Returns true if Broodwar is in a game. Returns false for lobby and menu screens
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isLatComEnabled | ( | ) | [virtual] |
Returns true if latency compensation is enabled
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isMultiplayer | ( | ) | [virtual] |
Returns true if Broodwar is in a multiplayer game. Returns false for single player games and replays.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isPaused | ( | ) | [virtual] |
Returns true if Broodwar is paused. If the game is paused, Game::getFrameCount will continue to increase and AIModule::onFrame will still be called while paused.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isReplay | ( | ) | [virtual] |
Returns true if Broodwar is in a replay.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::issueCommand | ( | const std::set< BWAPI::Unit * > & | units, |
UnitCommand | command | ||
) | [virtual] |
Issues a command to a group of units
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isVisible | ( | int | tileX, |
int | tileY | ||
) | [virtual] |
Returns true if the specified build tile is visible. If the tile is concealed by fog of war, the function will return false.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isVisible | ( | TilePosition | position | ) | [virtual] |
Returns true if the specified build tile is visible. If the tile is concealed by fog of war, the function will return false.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::isWalkable | ( | int | walkX, |
int | walkY | ||
) | [virtual] |
Returns true if the specified walk tile is walkable. The values of x and y are in walk tile coordinates (different from build tile coordinates). Note that this just uses the static map data. You will also need to make sure no ground units are on the coresponding build tile to see if its currently walkable. To do this, see unitsOnTile.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::leaveGame | ( | ) | [virtual] |
Leaves the current match and goes to the after-game stats screen.
Implements BWAPI::Game.
virtual std::string BWAPI::GameImpl::mapFileName | ( | ) | [virtual] |
Returns the file name of the current map.
Implements BWAPI::Game.
virtual std::string BWAPI::GameImpl::mapHash | ( | ) | [virtual] |
Returns the SHA-1 hash of the map file.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::mapHeight | ( | ) | [virtual] |
Returns the height of the current map, in build tile units. To get the height of the current map in walk tile units, multiply by 4. To get the height of the current map in Position units, multiply by TILE_SIZE (which is 32).
Implements BWAPI::Game.
virtual std::string BWAPI::GameImpl::mapName | ( | ) | [virtual] |
Returns the name/title of the current map.
Implements BWAPI::Game.
virtual std::string BWAPI::GameImpl::mapPathName | ( | ) | [virtual] |
Returns the full path name of the current map.
Implements BWAPI::Game.
virtual int BWAPI::GameImpl::mapWidth | ( | ) | [virtual] |
Returns the width of the current map, in build tile units. To get the width of the current map in walk tile units, multiply by 4. To get the width of the current map in Position units, multiply by TILE_SIZE (which is 32).
Implements BWAPI::Game.
virtual Player* BWAPI::GameImpl::neutral | ( | ) | [virtual] |
Returns a pointer to the neutral player.
Implements BWAPI::Game.
virtual std::set<BWAPI::Player*>& BWAPI::GameImpl::observers | ( | ) | [virtual] |
Returns a set of all the observer players that have not left.
Implements BWAPI::Game.
void BWAPI::GameImpl::onMatchEnd | ( | ) |
void BWAPI::GameImpl::onMatchFrame | ( | ) |
void BWAPI::GameImpl::onMatchStart | ( | ) |
virtual void BWAPI::GameImpl::pauseGame | ( | ) | [virtual] |
Pauses the game. If the game is paused, Game::getFrameCount will not increase however AIModule::onFrame will still be called while paused.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::pingMinimap | ( | int | x, |
int | y | ||
) | [virtual] |
Pings the given position on the minimap.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::pingMinimap | ( | BWAPI::Position | p | ) | [virtual] |
Pings the given position on the minimap.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::printf | ( | const char * | format, |
... | |||
) | [virtual] |
Prints text on the screen. Text is not sent to other players in multiplayer games.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::restartGame | ( | ) | [virtual] |
Restarts the match. Works the same way as if you restarted the match from the menu screen. Only available in single player mode.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::resumeGame | ( | ) | [virtual] |
Resumes the game.
Implements BWAPI::Game.
virtual Player* BWAPI::GameImpl::self | ( | ) | [virtual] |
Returns a pointer to the player that BWAPI controls. In replays this will return null.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::sendText | ( | const char * | format, |
... | |||
) | [virtual] |
Sends text to other players - as if it were entered in chat. In single player games and replays, this will just print the text on the screen. If the game is a single player match and not a replay, then this function can be used to execute cheat codes, i.e. Broodwar->sendText("show me the money").
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::sendTextEx | ( | bool | toAllies, |
const char * | format, | ||
... | |||
) | [virtual] |
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::setAlliance | ( | BWAPI::Player * | player, |
bool | allied = true , |
||
bool | alliedVictory = true |
||
) | [virtual] |
Sets the BWAPI player's alliance with another player.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::setCommandOptimizationLevel | ( | int | level = 2 | ) | [virtual] |
Sets the level of command optimizations. 0 = No optimization. 1 = Some optimization (Stop, Hold Position, Siege, Burrow, etc.). 2 = More optimization (Train, Set Rally, Lift, [multi-select buildings]). 3 = Maximum optimization (Attack/Move to position, use ability at position, etc.).
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::setFrameSkip | ( | int | frameSkip = 1 | ) | [virtual] |
Sets the frame skip value. 1 = normal
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::setGUI | ( | bool | enabled = true | ) | [virtual] |
Sets the rendering state of the Starcraft GUI
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::setLastError | ( | BWAPI::Error | e | ) | [virtual] |
Sets the last error code.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::setLatCom | ( | bool | isEnabled | ) | [virtual] |
Use to enable or disable latency compensation. Default: Enabled
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::setLocalSpeed | ( | int | speed = -1 | ) | [virtual] |
Sets the speed of the game to the given number. Lower numbers are faster. 0 is the fastest speed StarCraft can handle (which is about as fast as the fastest speed you can view a replay at). Any negative value will reset the speed to the StarCraft default.
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::setMap | ( | const char * | mapFileName | ) | [virtual] |
Changes the map to the one specified. Changes do not take effect unless the game is restarted.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::setScreenPosition | ( | int | x, |
int | y | ||
) | [virtual] |
Moves the screen to the given position on the map. The position specified where the top left corner of the screen will be.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::setScreenPosition | ( | BWAPI::Position | p | ) | [virtual] |
Moves the screen to the given position on the map. The position specified where the top left corner of the screen will be.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::setTextSize | ( | int | size = 1 | ) | [virtual] |
Implements BWAPI::Game.
virtual bool BWAPI::GameImpl::setVision | ( | BWAPI::Player * | player, |
bool | enabled = true |
||
) | [virtual] |
Sets the BWAPI player's vision with another player.
Implements BWAPI::Game.
virtual void BWAPI::GameImpl::startGame | ( | ) | [virtual] |
Used to start the game while in a lobby. Note that there is no onLobbyEnter callback yet, so this function cannot be used at this time.
Implements BWAPI::Game.