24 lines
546 B
Rust
24 lines
546 B
Rust
use crate::engine::Engine;
|
|
use crate::player::PlayerConsole;
|
|
|
|
pub struct Lobby {}
|
|
|
|
impl Lobby {
|
|
pub fn new() -> Lobby {
|
|
Lobby {}
|
|
}
|
|
|
|
pub fn run(self) -> Result<(), Box<dyn std::error::Error>> {
|
|
loop {
|
|
let p1 = Box::new(PlayerConsole::new("Gopher"));
|
|
let p2 = Box::new(PlayerConsole::new("Rustacean"));
|
|
let mut engine = Engine::new(p1, p2);
|
|
|
|
match engine.run() {
|
|
Ok(_) => continue,
|
|
Err(e) => return Err(e),
|
|
};
|
|
}
|
|
}
|
|
}
|