From 8fa3fa881bc3b954e136295fe6cc7022737ae9db Mon Sep 17 00:00:00 2001 From: Guillaume Pasquet Date: Tue, 12 Nov 2019 14:22:19 +0100 Subject: Refactor all the things! --- src/main.rs | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index c4c6f4f..f7e7f0f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,16 +4,14 @@ extern crate pancurses; #[macro_use] extern crate text_io; -mod character; -mod computer; +mod entities; mod world; +mod tiling; -use std::env; -use character::Player; -use character::Character; -use computer::Enemy; +use entities::{Character, Player, Entity}; use pancurses::{Window, initscr, endwin, Input, noecho}; -use world::{Dungeon, Level, Generable, TileType}; +use world::{Dungeon, Level, Generatable}; +use tiling::TileType; fn tile_to_str(tile: &TileType) -> &str { match tile { @@ -42,18 +40,6 @@ fn render_level(window: &Window, level: &Level) { } } -fn debug_level(level: Level) { - let grid = level.to_tilegrid().unwrap(); - - for line in grid.raw_data().iter() { - for block in line.iter() { - print!("{}", tile_to_str(block)); - } - print!("\n"); - } -} - - fn main() { let window = initscr(); let mut level = 0; -- cgit v1.2.3