aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Pasquet <dev@etenil.net>2019-11-19 04:23:13 +0000
committerGuillaume Pasquet <dev@etenil.net>2019-11-19 04:23:13 +0000
commit591e0dad70e8aa9514039f9193dfcd57d6334a7f (patch)
tree2982efd75f58f1d309a08d49058087d6537c9fb6
parent0a3b3bf177d54c68a22f061a7087d20d19488bba (diff)
Ensure privacy is private
-rw-r--r--src/state.rs4
-rw-r--r--src/world.rs8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/state.rs b/src/state.rs
index 2c5f16f..1a2387d 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -2,7 +2,7 @@ use crossterm::cursor::MoveTo;
use crossterm::{queue, Output};
use std::io::{stdout, Write};
-use crate::entities::{Character, Player, Entity};
+use crate::entities::{Character, Entity, Player};
use crate::tiling::{tile_to_str, TileGrid};
use crate::world::{Dungeon, Generatable, Level};
@@ -82,7 +82,7 @@ impl State {
let mut sout = stdout();
queue!(
sout,
- MoveTo(0, (self.dungeon.ysize + 1) as u16),
+ MoveTo(0, (self.dungeon.get_ysize() + 1) as u16),
Output(self.player.stats())
)
.unwrap();
diff --git a/src/world.rs b/src/world.rs
index 21d0d86..d8d44f9 100644
--- a/src/world.rs
+++ b/src/world.rs
@@ -221,8 +221,8 @@ pub struct Level {
}
pub struct Dungeon {
- pub xsize: usize,
- pub ysize: usize,
+ xsize: usize,
+ ysize: usize,
depth: usize,
pub levels: Vec<Level>,
}
@@ -253,6 +253,10 @@ impl Dungeon {
levels: vec![],
}
}
+
+ pub fn get_ysize(&self) -> usize {
+ self.ysize
+ }
}
impl Generatable for Dungeon {