diff options
author | Guillaume Pasquet <dev@etenil.net> | 2019-11-19 04:23:57 +0000 |
---|---|---|
committer | Guillaume Pasquet <dev@etenil.net> | 2019-11-19 04:23:57 +0000 |
commit | 649e209c64a86e951bf24805e369143888f33c9a (patch) | |
tree | d7cb3e64f924392ba9683b01a69d94bae9b8f51b /src/world.rs | |
parent | 591e0dad70e8aa9514039f9193dfcd57d6334a7f (diff) |
`get_` getters don't appear to be idiomatic rust
Diffstat (limited to 'src/world.rs')
-rw-r--r-- | src/world.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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 } |