summaryrefslogtreecommitdiff
path: root/src/sim/world.rs
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2026-08-13 21:31:53 -0700
committerKai Stevenson <kai@kaistevenson.com>2026-08-13 21:31:53 -0700
commit69f0407637a071d79d73115e4ae9c0ab526066a7 (patch)
treec22f8fa6e761985a70d86ad023b54fc374f6f6a3 /src/sim/world.rs
parentfeefeecec6c6050635b2c016452dfa1529575987 (diff)
parallelization
Diffstat (limited to 'src/sim/world.rs')
-rw-r--r--src/sim/world.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sim/world.rs b/src/sim/world.rs
index 3c7b05b..7775744 100644
--- a/src/sim/world.rs
+++ b/src/sim/world.rs
@@ -36,10 +36,18 @@ impl World {
}
// VERY EXPENSIVE
- pub fn set_cell_from_game_position(&mut self, x: i32, y: i32, cell: Cell) -> () {
+ pub fn set_cell_from_game_position(
+ &mut self,
+ x: i32,
+ y: i32,
+ cell: Cell,
+ sleeping: bool,
+ ) -> () {
let ((cx, cy), (dx, dy)) = World::split_game_position(x, y);
if let Some(&idx) = self.chunk_position_to_chunk_idx.get(&(cx, cy)) {
self.chunks[idx].set_cell_at_local_position(dx, dy, cell);
+ // this is a temporary hack
+ self.chunks[idx].sleeping = sleeping;
}
}
@@ -56,7 +64,7 @@ impl World {
};
for y in -10..10 {
- for x in -10..10 {
+ for x in -50..50 {
world.insert(x, y, Chunk::void());
}
}