Skip to content

Commit 076ec71

Browse files
committed
feat: primitive save state
1 parent b51db0f commit 076ec71

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/blocks/block_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl BlockType {
3737
3 => Self::stone(),
3838
4 => Self::wood(),
3939
5 => Self::grass(),
40-
_ => panic!("Invalid id")
40+
_ => panic!("Invalid id"),
4141
}
4242
}
4343
pub fn to_id(&self) -> u32 {

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
8888
} => {
8989
state.world.save_state();
9090
target.exit();
91-
},
91+
}
9292

9393
WindowEvent::KeyboardInput { event, .. } => {
9494
state.handle_keypress(event, delta_time.as_secs_f32())

src/world.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ impl World {
284284
player.current_chunk = current_chunk;
285285
}
286286
pub fn save_state(&self) {
287-
288287
// TODO: Player position
289288
for chunk in self.chunks.iter() {
290289
let chunkbrw = chunk.lock().unwrap();

0 commit comments

Comments
 (0)