-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameEngine.hpp
More file actions
40 lines (30 loc) · 940 Bytes
/
GameEngine.hpp
File metadata and controls
40 lines (30 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <vector>
#include "referee/engine.hpp"
namespace spring_native
{
using GameState = referee::BoardState;
using TurnResult = referee::TurnResult;
class GameEngine
{
public:
static GameState create_map_from_seed(long long seed, int league_level)
{
return referee::Engine::create_map_from_seed(seed, league_level);
}
static std::vector<std::string> get_initial_inputs(const GameState &state, int player_id)
{
return referee::Engine::get_initial_inputs(state, player_id);
}
static std::vector<std::string> get_turn_inputs(const GameState &state, int player_id)
{
return referee::Engine::get_turn_inputs(state, player_id);
}
TurnResult apply_turn(GameState &state, const std::array<std::string, 2> &player_commands, int league_level)
{
return engine_.apply_turn(state, player_commands, league_level);
}
private:
referee::Engine engine_;
};
} // namespace spring_native