aboutsummaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
authorGuillaume Pasquet <guillaume.pasquet@eggplant.io>2019-11-12 16:11:32 +0100
committerGuillaume Pasquet <guillaume.pasquet@eggplant.io>2019-11-12 16:11:32 +0100
commitdbaeddc419c2d070ce175ef2bcda9fa7c98c6941 (patch)
tree4bc6737748d84b194718dc5c4a0a959286c55589 /src/state.rs
parent0cee0cbadc19e95dfaae57eb9a54b38026481425 (diff)
parentd249f7a63f007fcc494e4c446c4845e4f9d0a523 (diff)
Merge branch 'master' of github.com:Etenil/roguerust
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]
}