TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Classes | Public Member Functions | Public Attributes | Friends | List of all members
torchcraft::State Class Reference

#include <state.h>

Inherits RefCounted.

Classes

struct  PlayerInfo
 
struct  Position
 

Public Member Functions

 State (bool microBattles=false, std::set< BW::UnitType > onlyConsiderTypes=std::set< BW::UnitType >())
 
 State (const State &other)
 
 State (State &&other)
 
 ~State ()
 
Stateoperator= (State other)
 
bool microBattles () const
 
const std::set< BW::UnitType > & onlyConsiderTypes () const
 
void setMicroBattles (bool microBattles)
 
void setOnlyConsiderTypes (std::set< BW::UnitType > types)
 
void reset ()
 
std::vector< std::string > update (const fbs::HandshakeServer *handshake)
 
std::vector< std::string > update (const fbs::StateUpdate *stateUpdate)
 
std::vector< std::string > update (const fbs::EndGame *end)
 
std::vector< std::string > update (const fbs::PlayerLeft *left)
 
void trackAliveUnits (std::vector< std::string > &upd, const std::set< BW::UnitType > &considered)
 
int getUpgradeLevel (BW::UpgradeType ut)
 
bool hasResearched (BW::TechType tt)
 
- Public Member Functions inherited from RefCounted
 RefCounted ()
 
virtual ~RefCounted ()
 
void incref ()
 
void decref ()
 

Public Attributes

int lag_frames
 
int map_size [2]
 
std::vector< uint8_t > ground_height_data
 
std::vector< uint8_t > walkable_data
 
std::vector< uint8_t > buildable_data
 
std::string map_name
 
std::string map_title
 
std::vector< Positionstart_locations
 
std::map< int, PlayerInfoplayer_info
 
int player_id
 
int neutral_id
 
bool replay
 
Frameframe
 
std::vector< int > deaths
 
int frame_from_bwapi
 
int battle_frame_count
 
bool game_ended
 
bool game_won
 
bool battle_just_ended
 
bool battle_won
 
bool waiting_for_restart
 
int last_battle_ended
 
std::string img_mode
 
int screen_position [2]
 
std::vector< uint8_t > visibility
 
int visibility_size [2]
 
std::vector< uint8_t > image
 
int image_size [2]
 
std::unordered_map< int32_t, int32_t > aliveUnits
 
std::unordered_map< int32_t, int32_t > aliveUnitsConsidered
 
std::unordered_map< int32_t, std::vector< Unit > > units
 
uint64_t numUpdates = 0
 

Friends

void swap (State &a, State &b)
 

Constructor & Destructor Documentation

torchcraft::State::State ( bool  microBattles = false,
std::set< BW::UnitType >  onlyConsiderTypes = std::set< BW::UnitType >() 
)
explicit
torchcraft::State::State ( const State other)
torchcraft::State::State ( State &&  other)
torchcraft::State::~State ( )

Member Function Documentation

int torchcraft::State::getUpgradeLevel ( BW::UpgradeType  ut)
inline
bool torchcraft::State::hasResearched ( BW::TechType  tt)
inline
bool torchcraft::State::microBattles ( ) const
inline
const std::set<BW::UnitType>& torchcraft::State::onlyConsiderTypes ( ) const
inline
State& torchcraft::State::operator= ( State  other)
void torchcraft::State::reset ( )
void torchcraft::State::setMicroBattles ( bool  microBattles)
inline
void torchcraft::State::setOnlyConsiderTypes ( std::set< BW::UnitType >  types)
inline
void torchcraft::State::trackAliveUnits ( std::vector< std::string > &  upd,
const std::set< BW::UnitType > &  considered 
)
std::vector<std::string> torchcraft::State::update ( const fbs::HandshakeServer *  handshake)
std::vector<std::string> torchcraft::State::update ( const fbs::StateUpdate *  stateUpdate)
std::vector<std::string> torchcraft::State::update ( const fbs::EndGame *  end)
std::vector<std::string> torchcraft::State::update ( const fbs::PlayerLeft *  left)

Friends And Related Function Documentation

void swap ( State a,
State b 
)
friend

Member Data Documentation

std::unordered_map<int32_t, int32_t> torchcraft::State::aliveUnits
std::unordered_map<int32_t, int32_t> torchcraft::State::aliveUnitsConsidered
int torchcraft::State::battle_frame_count
bool torchcraft::State::battle_just_ended
bool torchcraft::State::battle_won
std::vector<uint8_t> torchcraft::State::buildable_data
std::vector<int> torchcraft::State::deaths
Frame* torchcraft::State::frame
int torchcraft::State::frame_from_bwapi
bool torchcraft::State::game_ended
bool torchcraft::State::game_won
std::vector<uint8_t> torchcraft::State::ground_height_data
std::vector<uint8_t> torchcraft::State::image
int torchcraft::State::image_size[2]
std::string torchcraft::State::img_mode
int torchcraft::State::lag_frames
int torchcraft::State::last_battle_ended
std::string torchcraft::State::map_name
int torchcraft::State::map_size[2]
std::string torchcraft::State::map_title
int torchcraft::State::neutral_id
uint64_t torchcraft::State::numUpdates = 0
int torchcraft::State::player_id
std::map<int, PlayerInfo> torchcraft::State::player_info
bool torchcraft::State::replay
int torchcraft::State::screen_position[2]
std::vector<Position> torchcraft::State::start_locations
std::unordered_map<int32_t, std::vector<Unit> > torchcraft::State::units
std::vector<uint8_t> torchcraft::State::visibility
int torchcraft::State::visibility_size[2]
bool torchcraft::State::waiting_for_restart
std::vector<uint8_t> torchcraft::State::walkable_data

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