From 649e209c64a86e951bf24805e369143888f33c9a Mon Sep 17 00:00:00 2001 From: Guillaume Pasquet Date: Tue, 19 Nov 2019 04:23:57 +0000 Subject: `get_` getters don't appear to be idiomatic rust --- src/world.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/world.rs') diff --git a/src/world.rs b/src/world.rs index d8d44f9..20b510a 100644 --- a/src/world.rs +++ b/src/world.rs @@ -254,7 +254,7 @@ impl Dungeon { } } - pub fn get_ysize(&self) -> usize { + pub fn ysize(&self) -> usize { self.ysize } } @@ -263,13 +263,13 @@ impl Generatable for Dungeon { fn generate(&mut self) { let mut level = Level::new(self.xsize, self.ysize, 1, None); level.generate(); - let mut next_entrance = level.get_exit(); + let mut next_entrance = level.exit(); self.levels.push(level); for d in 1..self.depth { level = Level::new(self.xsize, self.ysize, d + 1, Some(next_entrance)); level.generate(); - next_entrance = level.get_exit(); + next_entrance = level.exit(); self.levels.push(level); } } @@ -312,18 +312,18 @@ impl Level { Ok(grid) } - pub fn get_start_point(&self) -> Point { + pub fn start_point(&self) -> Point { if !self.rooms.is_empty() { return self.rooms[0].center; } (0, 0) } - // pub fn get_entrance(&self) -> Point { + // pub fn entrance(&self) -> Point { // self.entrance // } - pub fn get_exit(&self) -> Point { + pub fn exit(&self) -> Point { self.exit } -- cgit v1.2.3