multi-board files
This commit is contained in:
@@ -6,6 +6,8 @@ pub mod game;
|
||||
pub mod log;
|
||||
/// Map file loading and saving (`.toml` format).
|
||||
pub mod map_file;
|
||||
/// World type: a named collection of boards in a single `.toml` file ([`world::World`], [`world::load`]).
|
||||
pub mod world;
|
||||
/// Rhai scripting runtime for board objects ([`script::ScriptHost`]).
|
||||
pub mod script;
|
||||
pub mod glyph;
|
||||
|
||||
@@ -104,7 +104,8 @@ fn start_map_greeter_runs_init() {
|
||||
// confirm the greeter read the board (interpolated message) and wrote to
|
||||
// itself (set_tile). Also guards the example from drifting out of sync.
|
||||
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../maps/start.toml");
|
||||
let board = crate::map_file::load(path).expect("load start.toml");
|
||||
let mut world = crate::world::load(path).expect("load start.toml");
|
||||
let board = world.boards.remove(&world.start).expect("start board");
|
||||
let mut game = GameState::new(board);
|
||||
game.run_init();
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user