aboutsummaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
authorIago Garrido <iago086@gmail.com>2019-11-12 16:11:21 +0100
committerIago Garrido <iago086@gmail.com>2019-11-12 16:11:21 +0100
commit34bdb3387e2cd4228aef39620be4d68ef3d7434b (patch)
treebfcbc38ebe6cf8e155fe29efa0176f0aebef8612 /src/state.rs
parent897efb3c736bac223df8c23722222797f65a33f9 (diff)
parentd249f7a63f007fcc494e4c446c4845e4f9d0a523 (diff)
Merge remote-tracking branch 'upstream/master'
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 f2ec249..8d0b164 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.player.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]
}