SC2API
An API for AI for StarCraft II
Classes | Typedefs | Enumerations
sc2_interfaces.h File Reference

A set of public facing interfaces used to query game state. More...

#include "sc2api/sc2_common.h"
#include "sc2api/sc2_action.h"
#include "sc2api/sc2_unit.h"
#include "sc2api/sc2_data.h"
#include <vector>

Go to the source code of this file.

Classes

class  sc2::ObservationInterface
 The ObservationInterface reflects the current state of the game. Guaranteed to be valid when OnGameStart or OnStep is called. More...
 
class  sc2::QueryInterface
 
struct  sc2::QueryInterface::PathingQuery
 
struct  sc2::QueryInterface::PlacementQuery
 
class  sc2::ActionInterface
 
class  sc2::ActionFeatureLayerInterface
 
class  sc2::ObserverActionInterface
 The ObserverActionInterface corresponds to the actions available in the observer UI. More...
 
class  sc2::DebugInterface
 

Typedefs

typedef std::function< bool(const Unit &unit)> sc2::Filter
 

Enumerations

enum  Visibility { Hidden = 0, Fogged = 1, Visible = 2, FullHidden = 3 }
 

Detailed Description

A set of public facing interfaces used to query game state.

Each function in this class is pure virtual but is not intended for a user of the API to overwrite. An implementation file that utilizes this interface will be responsible for its definition and should be of little concern to the consumer.

Typedef Documentation

typedef std::function<bool(const Unit& unit)> sc2::Filter

Used to filter out units when querying. You can use this filter to get all full health units, for example.

Parameters
unitThe unit in question to filter.
observationThe interface for querying game state to determine whether the unit should be filtered or not.
Returns
Whether or not to filter the unit in or out of the list. true will add the unit, false will leave it out of the list.
See also
GetUnits()