diff --git a/src/simulator/crates/mc-flora/src/engine.rs b/src/simulator/crates/mc-flora/src/engine.rs index 286a60fb..ab07fdc2 100644 --- a/src/simulator/crates/mc-flora/src/engine.rs +++ b/src/simulator/crates/mc-flora/src/engine.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use std::collections::{BTreeMap, HashMap}; use mc_core::grid::GridState; use rayon::prelude::*; @@ -74,7 +74,7 @@ const EMERGENCE_INTERVAL: u64 = 10; /// Owns per-tile flora populations and the species registry. pub struct FloraEngine { /// Per-tile flora populations, keyed by (col, row). - pub tile_populations: HashMap<(i32, i32), Vec>, + pub tile_populations: BTreeMap<(i32, i32), Vec>, /// All known flora species, keyed by id. pub species_registry: HashMap, /// Next species ID to assign on generation. @@ -86,7 +86,7 @@ pub struct FloraEngine { impl FloraEngine { pub fn new() -> Self { Self { - tile_populations: HashMap::new(), + tile_populations: BTreeMap::new(), species_registry: HashMap::new(), next_species_id: 1, tick_count: 0,