diff options
-rw-r--r-- | src/state.rs | 10 | ||||
-rw-r--r-- | src/tiling.rs | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/state.rs b/src/state.rs index 1f50f1a..8d0b164 100644 --- a/src/state.rs +++ b/src/state.rs @@ -5,18 +5,18 @@ use crate::entities::{Character, Entity, Render}; use crate::world::{Dungeon, Generatable, Level}; pub struct State { - pub character: Character, + pub player: Character, pub dungeon: Dungeon, pub level: usize, } impl State { pub fn new( - character: Character, + player: Character, dungeon: Dungeon, - ) -> State { + ) -> Self { State { - character: character, + player: player, dungeon: dungeon, level: 0, } @@ -24,7 +24,7 @@ impl State { pub fn init(&mut self) { self.dungeon.generate(); - self.character.place(self.current_level().get_start_point()); + self.player.place(self.current_level().get_start_point()); } pub fn render_level(&self, window: &Window) { diff --git a/src/tiling.rs b/src/tiling.rs index d443fb6..fbaae40 100644 --- a/src/tiling.rs +++ b/src/tiling.rs @@ -7,7 +7,7 @@ pub struct TileGrid { grid: Vec<Vec<TileType>> } -impl<'a> TileGrid { +impl TileGrid { pub fn new(xsize: usize, ysize: usize) -> TileGrid { let mut grid = TileGrid { grid: Vec::with_capacity(ysize) @@ -36,7 +36,7 @@ impl<'a> TileGrid { }) } - pub fn raw_data(&'a self) -> &'a Vec<Vec<TileType>> { + pub fn raw_data(& self) -> & Vec<Vec<TileType>> { &self.grid } } |