aboutsummaryrefslogtreecommitdiff
path: root/src/world.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.rs')
-rw-r--r--src/world.rs37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/world.rs b/src/world.rs
index 4204ddf..9f58030 100644
--- a/src/world.rs
+++ b/src/world.rs
@@ -1,7 +1,7 @@
use rand::Rng;
use pancurses::{Window};
use crate::entities::{Character, Entity, Enemy};
-use crate::tiling::{TileGrid, Tileable, TileType};
+use crate::tiling::{TileGrid, Tileable, TileType, draw_block};
pub type Point = (usize, usize);
@@ -188,39 +188,6 @@ impl Dungeon {
levels: vec![]
}
}
-
- pub fn debug_levels(&self) {
- for l in &self.levels {
- Dungeon::debug_level(l);
- }
- }
-
- fn draw_block(window: &Window, block: &TileType) {
- window.printw(Dungeon::tile_to_str(block));
- }
-
- fn debug_level(level: &Level) {
- let grid = level.to_tilegrid().unwrap();
-
- for line in grid.raw_data().iter() {
- for block in line.iter() {
- print!("{}", Dungeon::tile_to_str(block));
- }
- print!("\n");
- }
- }
-
- fn tile_to_str(tile: &TileType) -> &str {
- match tile {
- TileType::Floor => ".",
- TileType::Wall => "#",
- TileType::Empty => " ",
- TileType::StairsDown => ">",
- TileType::StairsUp => "<",
- TileType::Player => "@",
- _ => "?"
- }
- }
}
impl Generatable for Dungeon {
@@ -288,7 +255,7 @@ impl Level {
for (linenum, line) in grid.raw_data().iter().enumerate() {
for block in line.iter() {
- Dungeon::draw_block(&window, &block);
+ draw_block(&window, &block);
}
window.mv(linenum as i32, 0);
}