|
|
|
@ -29,24 +29,6 @@ fn render(e: &Entities, w: &World, b: &Screen) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[cfg(test)] |
|
|
|
|
mod tests { |
|
|
|
|
// TODO: tests, cleanup code in general
|
|
|
|
|
use super::*; |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn board() { |
|
|
|
|
let max_x = 20; |
|
|
|
|
let max_y = 20; |
|
|
|
|
|
|
|
|
|
let mut board = Screen::new(max_x, max_y); |
|
|
|
|
let mut world = World::new(); |
|
|
|
|
|
|
|
|
|
dbg!(board.is_in_bounds(&Point(0, 0))); |
|
|
|
|
dbg!(board.get_valid_movements(&Point(0, 0))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fn simulate(e: &mut Entities, w: &mut World, b: &mut Screen) { |
|
|
|
|
let cmds: Vec<BoardCommand> = e |
|
|
|
|
.data |
|
|
|
@ -90,8 +72,6 @@ fn main() { |
|
|
|
|
|
|
|
|
|
getmaxyx(stdscr(), &mut max_y, &mut max_x); |
|
|
|
|
|
|
|
|
|
// TODO: fix renderable to render different colors
|
|
|
|
|
|
|
|
|
|
let mut board = Screen::new(max_x, max_y); |
|
|
|
|
let mut world = World::new(); |
|
|
|
|
|
|
|
|
|