summaryrefslogtreecommitdiff
path: root/src/input/json.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/json.rs')
-rw-r--r--src/input/json.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/input/json.rs b/src/input/json.rs
index 32f98d0..544e5ed 100644
--- a/src/input/json.rs
+++ b/src/input/json.rs
@@ -21,12 +21,19 @@ pub fn read_bitwise_state_from_file(filename: &str) -> Result<bitwise_engine::Bi
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
struct State {
+ game_details: GameDetails,
players: Vec<Player>,
game_map: Vec<Vec<GameCell>>,
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
+struct GameDetails {
+ round: u16
+}
+
+#[derive(Deserialize)]
+#[serde(rename_all = "camelCase")]
struct Player {
player_type: char,
energy: u16,
@@ -149,7 +156,8 @@ impl State {
bitwise_engine::BitwiseGameState::new(
player, opponent,
- player_buildings, opponent_buildings
+ player_buildings, opponent_buildings,
+ self.game_details.round
)
}