SC2API
An API for AI for StarCraft II
Public Types | Public Member Functions | List of all members
sc2::DebugInterface Class Referenceabstract

#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
 

Detailed Description

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.

Member Function Documentation

virtual void sc2::DebugInterface::DebugBoxOut ( const Point3D p_min,
const Point3D p_max,
Color  color = Colors::White 
)
pure virtual

Outputs a box specified as two 3D points in the game world. Map coordinates are used.

Parameters
p0One corner of the box.
p1The far corner of the box.
color(Optional) Color of the lines.
virtual void sc2::DebugInterface::DebugCreateUnit ( UnitTypeID  unit_type,
const Point2D p,
uint32_t  player_id = 1,
uint32_t  count = 1 
)
pure virtual

Creates a unit at the given position.

Parameters
unit_typeType of unit to create.
pPosition to create the unit at.
player_idPlayer the unit should belong to.
countNumber of units to create.
virtual void sc2::DebugInterface::DebugEndGame ( bool  victory = false)
pure virtual

Ends a game.

Parameters
victoryIf true, this player is victorious. If false, this player surrenders.
virtual void sc2::DebugInterface::DebugKillUnit ( const Unit unit)
pure virtual

Destroy a unit.

Parameters
tagUnit to destroy.
virtual void sc2::DebugInterface::DebugLineOut ( const Point3D p0,
const Point3D p1,
Color  color = Colors::White 
)
pure virtual

Outputs a line between two 3D points in the game world. Map coordinates are used.

Parameters
p0The starting position of the line.
p1The ending position of the line.
color(Optional) Color of the line.
virtual void sc2::DebugInterface::DebugMoveCamera ( const Point2D pos)
pure virtual

Sets the position of the camera.

Parameters
posThe camera position in world space.
virtual void sc2::DebugInterface::DebugSetEnergy ( float  value,
const Unit unit 
)
pure virtual

Sets the energy level on a unit.

Parameters
valueThe new energy level.
tagThe unit.
virtual void sc2::DebugInterface::DebugSetLife ( float  value,
const Unit unit 
)
pure virtual

Sets the life on a unit.

Parameters
valueThe new life.
tagThe unit.
virtual void sc2::DebugInterface::DebugSetShields ( float  value,
const Unit unit 
)
pure virtual

Sets shields on a unit.

Parameters
valueThe new shields.
tagThe unit.
virtual void sc2::DebugInterface::DebugSphereOut ( const Point3D p,
float  r,
Color  color = Colors::White 
)
pure virtual

Outputs a sphere specified as a 3D point in the game world and a radius. Map coordinates are used.

Parameters
pCenter of the sphere.
rRadius of the sphere.
color(Optional) Color of the lines.
virtual void sc2::DebugInterface::DebugTestApp ( AppTest  app_test,
int  delay_ms = 0 
)
pure virtual

Cause the game to fail; useful to test library behavior.

Parameters
app_testState to put the game into.
delay_msTime to elapse before invoking the game state.
virtual void sc2::DebugInterface::DebugTextOut ( const std::string &  out,
Color  color = Colors::White 
)
pure virtual

Outputs text at the top, left of the screen.

Parameters
outThe string of text to display.
color(Optional) Color of the text.
virtual void sc2::DebugInterface::DebugTextOut ( const std::string &  out,
const Point2D pt_virtual_2D,
Color  color = Colors::White,
uint32_t  size = 8 
)
pure virtual

Outputs text at any 2D point on the screen. Coordinate ranges are 0..1 in X and Y.

Parameters
outThe string of text to display.
pt_virtual_2DThe screen position to draw text at.
color(Optional) Color of the text.
size(Optional) Pixel height of the text.
virtual void sc2::DebugInterface::DebugTextOut ( const std::string &  out,
const Point3D pt3D,
Color  color = Colors::White,
uint32_t  size = 8 
)
pure virtual

Outputs text at any 3D point in the game world. Map coordinates are used.

Parameters
outThe string of text to display.
pt3DThe world position to draw text at.
color(Optional) Color of the text.
size(Optional) Pixel height of the text.
virtual void sc2::DebugInterface::SendDebug ( )
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.


The documentation for this class was generated from the following file: