diff options
author | Guillaume Pasquet <guillaume.pasquet@eggplant.io> | 2019-11-12 14:22:19 +0100 |
---|---|---|
committer | Guillaume Pasquet <guillaume.pasquet@eggplant.io> | 2019-11-12 14:22:19 +0100 |
commit | 8fa3fa881bc3b954e136295fe6cc7022737ae9db (patch) | |
tree | 996c5f1aa20bec283504190d5c372e51b02be085 /src/main.rs | |
parent | ec671aa9b56c53d76ce310f0772ee05c97064d3f (diff) |
Refactor all the things!
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 24 |
1 files changed, 5 insertions, 19 deletions
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; |