aboutsummaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
authorGuillaume <g@bitimplosion.com>2019-11-12 16:10:12 +0100
committerGitHub <noreply@github.com>2019-11-12 16:10:12 +0100
commitd249f7a63f007fcc494e4c446c4845e4f9d0a523 (patch)
tree4dd84347c10919c29d873210f02cf96b86b3e240 /src/state.rs
parente8e931794052455d93517d35c75bb98b7829e70d (diff)
parent8b11578ed5d2b254c7b0f827170aadac6490434b (diff)
Merge pull request #6 from lferro9000/add_player_character_in_map
Add player character in map
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/state.rs b/src/state.rs
index 20b49d7..1f50f1a 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -1,7 +1,7 @@
use pancurses::Window;
use std::env;
-use crate::entities::{Character, Entity};
+use crate::entities::{Character, Entity, Render};
use crate::world::{Dungeon, Generatable, Level};
pub struct State {
@@ -27,19 +27,14 @@ impl State {
self.character.place(self.current_level().get_start_point());
}
- pub fn debug(&self) {
- match env::var("DEBUG") {
- Ok(_) => {
- self.dungeon.debug_levels();
- },
- Err(_) => ()
- };
- }
-
pub fn render_level(&self, window: &Window) {
self.current_level().render(window);
}
+ pub fn show_character(&self, window: &Window) {
+ self.character.render(window);
+ }
+
fn current_level(&self) -> &Level {
&self.dungeon.levels[self.level]
}