diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2020-04-10 23:17:35 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2020-04-10 23:17:35 +0200 |
commit | f3f798441e56afec9e6357c96274f90bf4ea6947 (patch) | |
tree | ab65f01f4757059c2ab1d3f0c21b9c6a625f0763 /src/state.rs | |
parent | 124c89cdeadc53457b016c9f8aa1ba3c4a1aa15d (diff) |
Game state from JSON state
Diffstat (limited to 'src/state.rs')
-rw-r--r-- | src/state.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/state.rs b/src/state.rs index 45e39eb..1dfa21d 100644 --- a/src/state.rs +++ b/src/state.rs @@ -9,28 +9,28 @@ pub enum GameStatus { } pub struct GameState { - status: GameStatus, - players: [Player; 2], - obstacles: Vec<Position>, - powerup_oils: Vec<Position>, - powerup_boosts: Vec<Position>, - finish_lines: Vec<Position>, + pub status: GameStatus, + pub players: [Player; 2], + pub obstacles: Vec<Position>, + pub powerup_oils: Vec<Position>, + pub powerup_boosts: Vec<Position>, + pub finish_lines: Vec<Position>, } pub struct Player { - position: Position, - next_position: Position, - speed: usize, - boost_remaining: usize, - oils: usize, - boosts: usize, - finished: bool, + pub position: Position, + pub next_position: Position, + pub speed: usize, + pub boost_remaining: usize, + pub oils: usize, + pub boosts: usize, + pub finished: bool, } #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Position { - x: usize, - y: usize, + pub x: usize, + pub y: usize, } impl GameState { |