14 static const Tag NullTag = 0LL;
72 PlayerSetup(PlayerType in_type, Race in_race,
Agent* in_agent =
nullptr, Difficulty in_difficulty = Easy) :
82 return PlayerSetup(PlayerType::Participant, race, agent);
99 bool IsValid()
const {
100 return game_port > 0 && base_port > 0;
107 std::vector<PortSet> client_ports;
114 bool IsValid()
const {
117 if (!server_ports.IsValid())
119 if (client_ports.size() < 1)
121 for (std::size_t i = 0; i < client_ports.size(); ++i)
122 if (!client_ports[i].IsValid())
129 static const int max_path_size = 512;
130 static const int max_version_size = 32;
131 static const int max_num_players = 16;
153 race_selected(Random) {
160 unsigned int duration_gameloops;
164 std::string map_name;
165 std::string map_path;
166 std::string replay_path;
168 std::string data_version;
173 duration_gameloops(0),
179 bool GetPlayerInfo(
ReplayPlayerInfo& replay_player_info,
int playerID)
const {
180 for (
int i = 0; i < num_players; ++i) {
181 if (playerID == players[i].player_id) {
182 replay_player_info = players[i];
190 float GetGameloopsPerSecond()
const {
191 return float(duration_gameloops) / duration;
Race race_selected
Selected player race. If the race is "Random", the race data member may be different.
Definition: sc2_gametypes.h:144
Common data types, including points, rectangles and colors.
int apm
Player actions per minute.
Definition: sc2_gametypes.h:140
Information about a replay file.
Definition: sc2_gametypes.h:158
Definition: sc2_action.h:9
Port setup for one or more clients in a game.
Definition: sc2_gametypes.h:105
Difficulty difficulty
Difficulty: Only for playing against the built-in AI.
Definition: sc2_gametypes.h:63
Port setup for a client.
Definition: sc2_gametypes.h:90
Information about a player in a replay.
Definition: sc2_gametypes.h:134
GameResult game_result
If the player won or lost.
Definition: sc2_gametypes.h:146
int player_id
Player ID.
Definition: sc2_gametypes.h:136
Agent * agent
Agent, if one is available.
Definition: sc2_gametypes.h:56
int mmr
Player ranking.
Definition: sc2_gametypes.h:138
Race race
Race: Terran, Zerg or Protoss. Only for playing against the built-in AI.
Definition: sc2_gametypes.h:61
Setup for a player in a game.
Definition: sc2_gametypes.h:52
PlayerType type
Player can be a Participant (usually an agent), Computer (in-built AI) or Observer.
Definition: sc2_gametypes.h:54
The base class for user defined bots.
Definition: sc2_agent.h:22
Race race
Actual player race.
Definition: sc2_gametypes.h:142