Registry refactor and clear queues on board entry

This commit is contained in:
2026-07-06 00:41:38 -05:00
parent b7063277e7
commit 78823fcf96
9 changed files with 97 additions and 85 deletions
+9
View File
@@ -585,6 +585,15 @@ impl Board {
fn terrain_layer_at(&self, x: usize, y: usize) -> Option<usize> {
(0..self.layers.len()).find(|&z| self.get(z, x, y).1 != Archetype::Empty)
}
/// Clear the queues of all objects on this board: called when entering a board, objects
/// don't retain their state across board visits (they get initialized again, but can
/// store things in the board registry)
pub fn clear_all_queues(&mut self) {
for obj in self.objects.values_mut() {
obj.queue.clear()
}
}
}
#[cfg(test)]