From 945ae96707f6b4065c89463047979a18ad8181aa Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sun, 1 Jul 2018 21:37:24 +0200 Subject: Started implementation of reading bitwise from json --- src/engine/bitwise_engine.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/engine') diff --git a/src/engine/bitwise_engine.rs b/src/engine/bitwise_engine.rs index 85c4352..4fad36f 100644 --- a/src/engine/bitwise_engine.rs +++ b/src/engine/bitwise_engine.rs @@ -65,6 +65,19 @@ impl GameState for BitwiseGameState { fn unoccupied_opponent_cells(&self) -> &[Point] { &EMPTY } } +impl BitwiseGameState { + pub fn new( + player: Player, opponent: Player, + player_buildings: PlayerBuildings, opponent_buildings: PlayerBuildings + ) -> BitwiseGameState { + BitwiseGameState { + status: GameStatus::Continue, + player, opponent, + player_buildings, opponent_buildings + } + } +} + impl PlayerBuildings { pub fn count_teslas(&self) -> usize { self.tesla_cooldowns.iter().filter(|t| t.active).count() -- cgit v1.2.3