docs: README, dead-code cleanup, smoke fixes

- README with run instructions and key reference
- lift the crate-level dead_code allowance; scope it to the anim library surface
- render paths tolerate a city that is still generating (district/building ids
  without entries), found by driving the app through a pty
- status messages show in the status bar, not only inside the inspector
- buffered JSON export (26 s -> 0.4 s for a large city)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Jeffrey Wilcke
2026-10-12 18:02:14 +02:00
parent 48320eb0e6
commit 3c75674489
15 changed files with 180 additions and 37 deletions

View File

@@ -366,13 +366,23 @@ impl City {
self.connectors.iter().filter(move |c| c.pos == p)
}
/// Panics if the id is unknown; use `district_opt` on a city that may still be generating.
pub fn district(&self, id: DistrictId) -> &District {
&self.districts[id.index()]
}
pub fn district_opt(&self, id: DistrictId) -> Option<&District> {
self.districts.get(id.index())
}
/// Panics if the id is unknown; use `building_opt` on a city that may still be generating.
pub fn building(&self, id: BuildingId) -> &Building {
&self.buildings[id.index()]
}
pub fn building_opt(&self, id: BuildingId) -> Option<&Building> {
self.buildings.get(id.index())
}
}
#[cfg(test)]