made game independent of controller
This commit is contained in:
parent
2b496865f7
commit
e1215a56d6
3 changed files with 50 additions and 13 deletions
13
src/main.rs
13
src/main.rs
|
@ -1,10 +1,17 @@
|
|||
use lib::game::{Game, Rules};
|
||||
use lib::{
|
||||
controller::{player::PlayerController, Controller},
|
||||
game::{Game, Rules},
|
||||
};
|
||||
|
||||
pub mod lib;
|
||||
|
||||
fn main() {
|
||||
let rules = Rules::default().size(4).spawn_per_turn(1);
|
||||
let mut game = Game::new(rules);
|
||||
let rules = Rules::default()
|
||||
.size(4)
|
||||
.spawn_per_turn(1)
|
||||
.clear_term(false);
|
||||
let controller = PlayerController::new().into_box();
|
||||
let mut game = Game::new(rules).controlled(controller);
|
||||
loop {
|
||||
game.turn().unwrap();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue