SC2API
An API for AI for StarCraft II
|
#include <sc2_interfaces.h>
Public Types | |
enum | AppTest { hang = 1, crash = 2, exit = 3 } |
Public Member Functions | |
virtual void | DebugTextOut (const std::string &out, Color color=Colors::White)=0 |
virtual void | DebugTextOut (const std::string &out, const Point2D &pt_virtual_2D, Color color=Colors::White, uint32_t size=8)=0 |
virtual void | DebugTextOut (const std::string &out, const Point3D &pt3D, Color color=Colors::White, uint32_t size=8)=0 |
virtual void | DebugLineOut (const Point3D &p0, const Point3D &p1, Color color=Colors::White)=0 |
virtual void | DebugBoxOut (const Point3D &p_min, const Point3D &p_max, Color color=Colors::White)=0 |
virtual void | DebugSphereOut (const Point3D &p, float r, Color color=Colors::White)=0 |
virtual void | DebugCreateUnit (UnitTypeID unit_type, const Point2D &p, uint32_t player_id=1, uint32_t count=1)=0 |
virtual void | DebugKillUnit (const Unit *unit)=0 |
virtual void | DebugShowMap ()=0 |
Makes the entire map visible, i.e., removes the fog-of-war. | |
virtual void | DebugEnemyControl ()=0 |
Enables commands to be issued to enemy units. | |
virtual void | DebugIgnoreFood ()=0 |
Disables the food check. | |
virtual void | DebugIgnoreResourceCost ()=0 |
Disables resource checks. | |
virtual void | DebugGiveAllResources ()=0 |
Gives a bunch of minerals and gas. | |
virtual void | DebugGodMode ()=0 |
Makes the units of a player indestructible. | |
virtual void | DebugIgnoreMineral ()=0 |
Ignores mineral costs. | |
virtual void | DebugNoCooldowns ()=0 |
Cooldowns become instant. | |
virtual void | DebugGiveAllTech ()=0 |
All tech becomes available. | |
virtual void | DebugGiveAllUpgrades ()=0 |
All upgrades are available. | |
virtual void | DebugFastBuild ()=0 |
Structures and units are built much faster. | |
virtual void | DebugSetScore (float score)=0 |
Sets the scripted "curriculum" score. | |
virtual void | DebugEndGame (bool victory=false)=0 |
virtual void | DebugSetEnergy (float value, const Unit *unit)=0 |
virtual void | DebugSetLife (float value, const Unit *unit)=0 |
virtual void | DebugSetShields (float value, const Unit *unit)=0 |
virtual void | DebugMoveCamera (const Point2D &pos)=0 |
virtual void | DebugTestApp (AppTest app_test, int delay_ms=0)=0 |
virtual void | SendDebug ()=0 |
DebugInterface draws debug text, lines and shapes. Available at any time after the game starts. Guaranteed to be valid when the OnStep event is called. All debug actions are queued and dispatched when SendDebug is called. All drawn primitives continue to draw without resending until another SendDebug is called.
|
pure virtual |
Outputs a box specified as two 3D points in the game world. Map coordinates are used.
p0 | One corner of the box. |
p1 | The far corner of the box. |
color | (Optional) Color of the lines. |
|
pure virtual |
Creates a unit at the given position.
unit_type | Type of unit to create. |
p | Position to create the unit at. |
player_id | Player the unit should belong to. |
count | Number of units to create. |
|
pure virtual |
Ends a game.
victory | If true, this player is victorious. If false, this player surrenders. |
|
pure virtual |
Destroy a unit.
tag | Unit to destroy. |
|
pure virtual |
Outputs a line between two 3D points in the game world. Map coordinates are used.
p0 | The starting position of the line. |
p1 | The ending position of the line. |
color | (Optional) Color of the line. |
|
pure virtual |
Sets the position of the camera.
pos | The camera position in world space. |
|
pure virtual |
Sets the energy level on a unit.
value | The new energy level. |
tag | The unit. |
|
pure virtual |
Sets the life on a unit.
value | The new life. |
tag | The unit. |
|
pure virtual |
Sets shields on a unit.
value | The new shields. |
tag | The unit. |
|
pure virtual |
Outputs a sphere specified as a 3D point in the game world and a radius. Map coordinates are used.
p | Center of the sphere. |
r | Radius of the sphere. |
color | (Optional) Color of the lines. |
|
pure virtual |
Cause the game to fail; useful to test library behavior.
app_test | State to put the game into. |
delay_ms | Time to elapse before invoking the game state. |
|
pure virtual |
Outputs text at the top, left of the screen.
out | The string of text to display. |
color | (Optional) Color of the text. |
|
pure virtual |
Outputs text at any 2D point on the screen. Coordinate ranges are 0..1 in X and Y.
out | The string of text to display. |
pt_virtual_2D | The screen position to draw text at. |
color | (Optional) Color of the text. |
size | (Optional) Pixel height of the text. |
|
pure virtual |
Outputs text at any 3D point in the game world. Map coordinates are used.
out | The string of text to display. |
pt3D | The world position to draw text at. |
color | (Optional) Color of the text. |
size | (Optional) Pixel height of the text. |
|
pure virtual |
Dispatch all queued debug commands. No debug commands will be sent until this is called. This will also clear or set new debug primitives like text and lines.