SC2API
An API for AI for StarCraft II
sc2_game_settings.h
1 #pragma once
2 
3 #include "sc2api/sc2_gametypes.h"
4 
5 #include <string>
6 #include <vector>
7 
8 namespace sc2 {
9 
11 struct ProcessInfo {
12  ProcessInfo() = default;
13  ProcessInfo(const std::string& path, uint64_t id, int port) :
14  process_path(path),
15  process_id(id),
16  port(port) {};
17 
18  std::string process_path;
19  uint64_t process_id;
20  int port;
21 };
22 
25  ProcessSettings() = default;
26  ProcessSettings(bool in_real_time,
27  int in_step_size,
28  const std::string& in_process_path,
29  const std::string& in_net_address,
30  int in_timeout_ms,
31  int in_port_start,
32  bool in_multi_threaded = false,
33  bool in_full_screen = false);
34 
35  bool realtime;
36  int step_size;
37  std::string process_path;
38  std::string data_version;
39  std::string net_address;
40  int timeout_ms;
41  int port_start;
42  // Run all OnSteps in parallel.
43  bool multi_threaded;
44  bool full_screen;
45  std::vector<std::string> extra_command_lines;
46  // PID and port of all running sc2 processes.
47  std::vector<ProcessInfo> process_info;
48 };
49 
52  RenderSettings() = default;
53  RenderSettings(int map_x, int map_y, int minimap_x, int minimap_y)
54  : map_x(map_x), map_y(map_y), minimap_x(minimap_x), minimap_y(minimap_y)
55  {}
57  int map_x = 800;
59  int map_y = 600;
61  int minimap_x = 300;
63  int minimap_y = 300;
64 };
65 
68  FeatureLayerSettings () = default;
69  FeatureLayerSettings (float in_camera_width, int in_map_x, int in_map_y, int in_minimap_x, int in_minimap_y)
70  : camera_width(in_camera_width), map_x(in_map_x), map_y(in_map_y), minimap_x(in_minimap_x), minimap_y(in_minimap_y)
71  {}
73  float camera_width = 24.0f;
75  int map_x = 64;
77  int map_y = 64;
79  int minimap_x = 64;
81  int minimap_y = 64;
82 };
83 
87 
88  bool use_feature_layers;
89  FeatureLayerSettings feature_layer_settings;
90  bool use_render;
91  RenderSettings render_settings;
92 };
93 
95 struct GameSettings {
96  GameSettings();
97 
98  std::string map_name;
99  std::vector<PlayerSetup> player_setup;
100  Ports ports;
101  bool raw_affects_selection = false;
102 };
103 
106  ReplaySettings();
107 
108  // Fill with replays to analyze.
109  std::vector<std::string> replay_file;
110  std::string replay_dir;
111  uint32_t player_id;
112 };
113 
115 enum class AppState {
116  normal, // The game application has behaved normally.
117  timeout, // A timeout has occurred, and the game application was terminated.
118  timeout_zombie, // A timeout has occurred, but the game application could not be terminated.
119  crashed // A crash has been detected.
120 };
121 
125 extern const char* kMapBelShirVestigeLE;
126 extern const char* kMapEmpty;
127 extern const char* kMapEmptyLong;
128 extern const char* kMapEmptyTall;
129 extern const char* kMapMarineMicro;
130 
131 }
Settings for an RGB rendered output.
Definition: sc2_game_settings.h:51
Information about a running process.
Definition: sc2_game_settings.h:11
Definition: sc2_action.h:9
Settings for rendered feature layer output.
Definition: sc2_game_settings.h:85
Settings to run the game process.
Definition: sc2_game_settings.h:24
Port setup for one or more clients in a game.
Definition: sc2_gametypes.h:130
Types used in setting up a game.
Settings for starting a replay.
Definition: sc2_game_settings.h:105
Settings for feature layer output.
Definition: sc2_game_settings.h:67
Settings for starting a game.
Definition: sc2_game_settings.h:95