SC2API
An API for AI for StarCraft II
sc2_map_info.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "sc2_common.h"
7 #include "sc2_gametypes.h"
8 #include <string>
9 #include <vector>
10 
11 namespace sc2 {
12 
14 struct ImageData {
15  int width;
16  int height;
17  int bits_per_pixel;
18  std::string data;
19 
20  ImageData();
21 };
22 
24 struct RenderedFrame {
25  ImageData map;
26  ImageData minimap;
27 };
28 
30 struct SpatialSetup {
32  float camera_width;
41 };
42 
46  bool raw;
51 };
52 
53 struct PlayerInfo {
54  uint32_t player_id;
55  PlayerType player_type;
56  Race race_requested;
57  Race race_actual;
58  Difficulty difficulty;
59 
60  PlayerInfo(uint32_t player_id, PlayerType player_type, Race race_requested, Race race_actual, Difficulty difficulty) :
61  player_id(player_id),
62  player_type(player_type),
63  race_requested(race_requested),
64  race_actual(race_actual),
65  difficulty(difficulty) {};
66 };
67 
69 struct GameInfo {
71  std::string map_name;
73  std::string local_map_path;
75  int width;
77  int height;
89  std::vector<Point2D> enemy_start_locations;
90  std::vector<Point2D> start_locations;
91 
95 
96  std::vector<PlayerInfo> player_info;
97 
98  GameInfo();
99 };
100 
101 }
int width
World width of a map.
Definition: sc2_map_info.h:75
int minimap_resolution_x
Number of pixels in X of the minimap.
Definition: sc2_map_info.h:38
std::string map_name
Plain text name of a map. Note that this may be different from the filename of the map...
Definition: sc2_map_info.h:71
std::string local_map_path
Filename of map. Includes the ".SC2Map" file extension.
Definition: sc2_map_info.h:73
Common data types, including points, rectangles and colors.
float camera_width
For feature layers only, determines the world space size of the camera.
Definition: sc2_map_info.h:32
Definition: sc2_common.h:49
Setup structure for feature layers or rendered images.
Definition: sc2_map_info.h:30
Definition: sc2_map_info.h:53
ImageData pathing_grid
Grid showing which cells are pathable by units.
Definition: sc2_map_info.h:79
SpatialSetup feature_layer
Feature layer data.
Definition: sc2_map_info.h:48
Definition: sc2_action.h:9
Point2D playable_max
The maximum coordinates of playable space. Points greater than this are not playable.
Definition: sc2_map_info.h:87
std::vector< Point2D > enemy_start_locations
Positions of possible enemy starting locations.
Definition: sc2_map_info.h:89
int height
World height of a map.
Definition: sc2_map_info.h:77
int map_resolution_y
Number of pixels in Y of the main game view.
Definition: sc2_map_info.h:36
Rendered data for a game frame.
Definition: sc2_map_info.h:24
InterfaceOptions options
Definition: sc2_map_info.h:94
ImageData placement_grid
Grid showing which cells can accept placement of structures.
Definition: sc2_map_info.h:83
Determines what type of data will be returned in observations.
Definition: sc2_map_info.h:44
int map_resolution_x
Number of pixels in X of the main game view.
Definition: sc2_map_info.h:34
bool raw
Raw data; essentially a list of units.
Definition: sc2_map_info.h:46
Point2D playable_min
The minimum coordinates of playable space. Points less than this are not playable.
Definition: sc2_map_info.h:85
Types used in setting up a game.
Initial data for a game and map.
Definition: sc2_map_info.h:69
int minimap_resolution_y
Number of pixels in Y of the minimap.
Definition: sc2_map_info.h:40
ImageData terrain_height
Height map of terrain.
Definition: sc2_map_info.h:81
SpatialSetup render
Rendered image data.
Definition: sc2_map_info.h:50
Data for a feature layer or rendered image.
Definition: sc2_map_info.h:14