aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 0293951..24a4bcb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -38,16 +38,35 @@ fn render_world(window: &Window, world: &World) {
}
}
+fn debug_world(world: &World) {
+ let grid = world.to_tilegrid();
+
+ for (line) in grid.raw_data().iter() {
+ for block in line.iter() {
+ print!("{}", match block {
+ TileType::Floor => ".",
+ TileType::Wall => "█",
+ TileType::Corridor => "#",
+ TileType::Empty => " ",
+ _ => "?"
+ });
+ }
+ print!("\n");
+ }
+}
+
fn main() {
let mut world = World::new(24);
world.generate();
- let window = initscr();
+ debug_world(&world);
+
+ // let window = initscr();
- render_world(&window, &world);
+ // render_world(&window, &world);
- window.refresh();
+ // window.refresh();
- window.getch();
- endwin();
+ // window.getch();
+ // endwin();
}