SC2API
An API for AI for StarCraft II
sc2_proto_to_pods.h
1 #pragma once
2 
3 #include "s2clientprotocol/sc2api.pb.h"
4 #include "sc2_map_info.h"
5 #include "sc2_score.h"
6 #include "sc2_unit.h"
7 #include "sc2_action.h"
8 
9 namespace sc2 {
10 
11 typedef MessageResponsePtr<SC2APIProtocol::ResponseObservation> ResponseObservationPtr;
12 typedef MessageResponsePtr<SC2APIProtocol::Observation> ObservationPtr;
13 typedef MessageResponsePtr<SC2APIProtocol::ObservationRaw> ObservationRawPtr;
14 typedef MessageResponsePtr<SC2APIProtocol::ObservationRender> ObservationRenderPtr;
15 typedef MessageResponsePtr<SC2APIProtocol::ResponsePing> ResponsePingPtr;
16 typedef MessageResponsePtr<SC2APIProtocol::ResponseGameInfo> ResponseGameInfoPtr;
17 typedef MessageResponsePtr<SC2APIProtocol::ResponseQuery> ResponseQueryPtr;
18 
19 bool Convert(const ObservationPtr& observation_ptr, Score& score);
20 bool Convert(const ObservationRawPtr& observation_ptr, UnitPool& unit_pool, uint32_t game_loop);
21 bool Convert(const ObservationPtr& observation_ptr, RenderedFrame& render);
22 bool Convert(const ResponseGameInfoPtr& response_game_info_ptr, GameInfo& game_info);
23 
24 void ConvertRawActions(const ResponseObservationPtr& response_observation_ptr, RawActions& actions);
25 void ConvertFeatureLayerActions(const ResponseObservationPtr& response_observation_ptr, SpatialActions& actions);
26 void ConvertRenderedActions(const ResponseObservationPtr& response_observation_ptr, SpatialActions& actions);
27 
28 Race ConvertRaceFromProto(SC2APIProtocol::Race race);
29 GameResult ConvertGameResultFromProto(SC2APIProtocol::Result result);
30 PlayerType ConvertPlayerTypeFromProto(SC2APIProtocol::PlayerType type);
31 Difficulty ConvertDifficultyFromProto(SC2APIProtocol::Difficulty difficulty);
32 
33 }
Unit data in an observation.
Definition: sc2_action.h:9
Information about a game map.
Scores accumulated in a game as calculated by the game engine.