multi board
This commit is contained in:
+2
-10
@@ -49,22 +49,14 @@ fn main() -> ExitCode {
|
||||
};
|
||||
|
||||
// Load before touching the terminal so load errors print to a normal screen.
|
||||
let board = match world::load(&path) {
|
||||
Ok(mut w) => match w.boards.remove(&w.start) {
|
||||
Some(b) => b,
|
||||
None => {
|
||||
eprintln!("error: start board '{}' not found", w.start);
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
},
|
||||
let mut game = match world::load(&path) {
|
||||
Ok(world) => GameState::from_world(world),
|
||||
Err(e) => {
|
||||
eprintln!("error loading {path}: {e}");
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
};
|
||||
|
||||
let mut game = GameState::new(board);
|
||||
|
||||
// `init` enters the alternate screen and raw mode; `restore` always undoes it.
|
||||
let mut terminal = ratatui::init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user