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/manager.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'src/sim/cell_manager/manager.rs') diff --git a/src/sim/cell_manager/manager.rs b/src/sim/cell_manager/manager.rs index 12cc1b7..6fa5f37 100644 --- a/src/sim/cell_manager/manager.rs +++ b/src/sim/cell_manager/manager.rs @@ -5,7 +5,6 @@ use crate::{ sim::{ cell::Cell, cell_manager::{chunk::Chunk, sim::sim_tick}, - entity::EntityId, }, }; @@ -46,40 +45,6 @@ impl CellManager { } } - // VERY EXPENSIVE - pub fn get_data_from_game_position(&self, x: i32, y: i32) -> Option { - let ((cx, cy), (dx, dy)) = CellManager::split_game_position(x, y); - self.chunk_position_to_chunk_idx - .get(&(cx, cy)) - .map(|&idx| self.chunks[idx].get_data_at_local_position(dx, dy)) - .flatten() - } - - // VERY EXPENSIVE - pub fn set_data_from_game_position(&mut self, x: i32, y: i32, data: u16) { - let ((cx, cy), (dx, dy)) = CellManager::split_game_position(x, y); - if let Some(&idx) = self.chunk_position_to_chunk_idx.get(&(cx, cy)) { - self.chunks[idx].set_data_at_local_position(dx, dy, data); - } - } - - // VERY EXPENSIVE - pub fn get_entity_from_game_position(&self, x: i32, y: i32) -> Option { - let ((cx, cy), (dx, dy)) = CellManager::split_game_position(x, y); - self.chunk_position_to_chunk_idx - .get(&(cx, cy)) - .map(|&idx| self.chunks[idx].get_entity_at_local_position(dx, dy)) - .flatten() - } - - // VERY EXPENSIVE - pub fn set_entity_from_game_position(&mut self, x: i32, y: i32, entity_id: EntityId) { - let ((cx, cy), (dx, dy)) = CellManager::split_game_position(x, y); - if let Some(&idx) = self.chunk_position_to_chunk_idx.get(&(cx, cy)) { - self.chunks[idx].set_entity_at_local_position(dx, dy, entity_id); - } - } - pub fn insert(&mut self, x: i32, y: i32, chunk: Chunk) { self.chunk_position_to_chunk_idx .insert((x, y), self.chunks.len()); -- cgit v1.3.1