diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2018-07-01 21:37:24 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2018-07-01 21:37:24 +0200 |
commit | 945ae96707f6b4065c89463047979a18ad8181aa (patch) | |
tree | 9c796d219201775dd4c534c9942e88546047ae46 /src/engine/bitwise_engine.rs | |
parent | d23a63288dec711b93dfa6702233c29287918cd9 (diff) |
Started implementation of reading bitwise from json
Diffstat (limited to 'src/engine/bitwise_engine.rs')
-rw-r--r-- | src/engine/bitwise_engine.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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() |