14 static const Tag NullTag = 0LL;
49 enum class ChatChannel {
77 PlayerSetup(PlayerType in_type, Race in_race,
Agent* in_agent =
nullptr, Difficulty in_difficulty = Easy) :
81 difficulty(in_difficulty) {
87 return PlayerSetup(PlayerType::Participant, race, agent);
90 static inline PlayerSetup CreateComputer(Race race, Difficulty difficulty = Easy) {
91 return PlayerSetup(PlayerType::Computer, race,
nullptr, difficulty);
104 bool IsValid()
const {
105 return game_port > 0 && base_port > 0;
112 std::vector<PortSet> client_ports;
119 bool IsValid()
const {
122 if (!server_ports.IsValid())
124 if (client_ports.size() < 1)
126 for (std::size_t i = 0; i < client_ports.size(); ++i)
127 if (!client_ports[i].IsValid())
134 static const int max_path_size = 512;
135 static const int max_version_size = 32;
136 static const int max_num_players = 16;
158 race_selected(Random) {
165 unsigned int duration_gameloops;
169 std::string map_name;
170 std::string map_path;
171 std::string replay_path;
173 std::string data_version;
178 duration_gameloops(0),
184 bool GetPlayerInfo(
ReplayPlayerInfo& replay_player_info,
int playerID)
const {
185 for (
int i = 0; i < num_players; ++i) {
186 if (playerID == players[i].player_id) {
187 replay_player_info = players[i];
195 float GetGameloopsPerSecond()
const {
196 return float(duration_gameloops) / duration;
201 PlayerResult(uint32_t player_id, GameResult result) : player_id(player_id), result(result) {};
Race race_selected
Selected player race. If the race is "Random", the race data member may be different.
Definition: sc2_gametypes.h:149
Common data types, including points, rectangles and colors.
Definition: sc2_gametypes.h:200
int apm
Player actions per minute.
Definition: sc2_gametypes.h:145
Information about a replay file.
Definition: sc2_gametypes.h:163
Definition: sc2_action.h:9
Port setup for one or more clients in a game.
Definition: sc2_gametypes.h:110
Difficulty difficulty
Difficulty: Only for playing against the built-in AI.
Definition: sc2_gametypes.h:68
Port setup for a client.
Definition: sc2_gametypes.h:95
Information about a player in a replay.
Definition: sc2_gametypes.h:139
GameResult game_result
If the player won or lost.
Definition: sc2_gametypes.h:151
int player_id
Player ID.
Definition: sc2_gametypes.h:141
Agent * agent
Agent, if one is available.
Definition: sc2_gametypes.h:61
int mmr
Player ranking.
Definition: sc2_gametypes.h:143
Race race
Race: Terran, Zerg or Protoss. Only for playing against the built-in AI.
Definition: sc2_gametypes.h:66
Setup for a player in a game.
Definition: sc2_gametypes.h:57
Definition: sc2_gametypes.h:207
PlayerType type
Player can be a Participant (usually an agent), Computer (in-built AI) or Observer.
Definition: sc2_gametypes.h:59
The base class for user defined bots.
Definition: sc2_agent.h:22
Race race
Actual player race.
Definition: sc2_gametypes.h:147