From 35f1bc48629456ee66cfb4643ca69b0811f02167 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sun, 23 Aug 2026 12:37:54 -0700 Subject: Revert "separate data from cells" This reverts commit e6742f59102f2beb305b813d7f0ee1d544bbc3e0. --- src/sim/cell_manager/chunk.rs | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'src/sim/cell_manager/chunk.rs') 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, - pub cell_entity: FxHashMap, 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 { - 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 { - 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, } -- cgit v1.3.1