diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2026-08-23 12:37:54 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2026-08-23 12:37:54 -0700 |
| commit | 35f1bc48629456ee66cfb4643ca69b0811f02167 (patch) | |
| tree | 80e271c7ad5fd074f27b33dcdcdafafc391d2d13 /src/sim/cell_manager/chunk.rs | |
| parent | e6742f59102f2beb305b813d7f0ee1d544bbc3e0 (diff) | |
Revert "separate data from cells"
This reverts commit e6742f59102f2beb305b813d7f0ee1d544bbc3e0.
Diffstat (limited to 'src/sim/cell_manager/chunk.rs')
| -rw-r--r-- | src/sim/cell_manager/chunk.rs | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/sim/cell_manager/chunk.rs b/src/sim/cell_manager/chunk.rs index 3bf1e9f..463242d 100644 --- a/src/sim/cell_manager/chunk.rs +++ b/src/sim/cell_manager/chunk.rs @@ -1,16 +1,13 @@ -use fxhash::FxHashMap; use glam::IVec2; use crate::{ config::{CELLS_IN_CHUNK, CHUNK_SIZE}, content::materials::MaterialForm, - sim::{cell::Cell, entity::EntityId, lib::marching_squares::Marchable}, + sim::{cell::Cell, lib::marching_squares::Marchable}, }; pub struct Chunk { pub cells: Box<[Cell; CELLS_IN_CHUNK]>, - pub cell_data: FxHashMap<usize, u16>, - pub cell_entity: FxHashMap<usize, EntityId>, pub sleeping: bool, pub needs_texture_update: bool, } @@ -25,35 +22,9 @@ impl Chunk { self.cells[x as usize + y as usize * CHUNK_SIZE as usize] = cell; } - #[inline] - pub fn get_data_at_local_position(&self, x: u8, y: u8) -> Option<u16> { - self.cell_data - .get(&(x as usize + y as usize * CHUNK_SIZE as usize)) - .copied() - } - #[inline] - pub fn set_data_at_local_position(&mut self, x: u8, y: u8, data: u16) { - self.cell_data - .insert(x as usize + y as usize * CHUNK_SIZE as usize, data); - } - - #[inline] - pub fn get_entity_at_local_position(&self, x: u8, y: u8) -> Option<EntityId> { - self.cell_entity - .get(&(x as usize + y as usize * CHUNK_SIZE as usize)) - .copied() - } - #[inline] - pub fn set_entity_at_local_position(&mut self, x: u8, y: u8, entity_id: EntityId) { - self.cell_entity - .insert(x as usize + y as usize * CHUNK_SIZE as usize, entity_id); - } - pub fn void() -> Self { Chunk { cells: Box::new([Cell::void(); CELLS_IN_CHUNK]), - cell_data: FxHashMap::default(), - cell_entity: FxHashMap::default(), sleeping: true, needs_texture_update: true, } |
