multi-board files

This commit is contained in:
2026-06-12 23:35:40 -05:00
parent 8e79b30583
commit e5c6affc41
4 changed files with 28 additions and 15 deletions
+9 -3
View File
@@ -19,7 +19,7 @@ mod input;
use kiln_core::game::GameState;
use kiln_core::log::LogLine;
use kiln_core::map_file;
use kiln_core::world;
use ratatui::Frame;
use ratatui::crossterm::event::{
self, DisableMouseCapture, EnableMouseCapture, Event, KeyEventKind,
@@ -49,8 +49,14 @@ fn main() -> ExitCode {
};
// Load before touching the terminal so load errors print to a normal screen.
let board = match map_file::load(&path) {
Ok(board) => board,
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;
}
},
Err(e) => {
eprintln!("error loading {path}: {e}");
return ExitCode::FAILURE;