feat(flora-engine): ✨ Introduce FloraEngine struct and plant growth models with biome interaction simulation logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
1c2f037e17
commit
8db313969b
1 changed files with 3 additions and 3 deletions
|
|
@ -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<FloraSlot>>,
|
||||
pub tile_populations: BTreeMap<(i32, i32), Vec<FloraSlot>>,
|
||||
/// All known flora species, keyed by id.
|
||||
pub species_registry: HashMap<u32, FloraSpecies>,
|
||||
/// 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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue