mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-18 03:41:52 +03:00
Add a headless API command to load a map with an empty simulation. #838
This commit is contained in:
parent
47962cfdbd
commit
921228b7bf
@ -161,6 +161,12 @@ fn handle_command(
|
||||
|
||||
Ok("flags changed and sim reloaded".to_string())
|
||||
}
|
||||
"/sim/load-blank" => {
|
||||
*map =
|
||||
Map::load_synchronously(get("map")?.to_string(), &mut Timer::new("load new map"));
|
||||
*sim = Sim::new(&map, SimOptions::default());
|
||||
Ok("map changed, blank simulation".to_string())
|
||||
}
|
||||
"/sim/get-time" => Ok(sim.time().to_string()),
|
||||
"/sim/goto-time" => {
|
||||
let t = Time::parse(get("t")?)?;
|
||||
|
Loading…
Reference in New Issue
Block a user