Add Serialize/Deserialize impls to various types

We want to be able to store this data to disk temporarily.
This commit is contained in:
Matthias Schiffer 2023-02-25 23:23:00 +01:00
parent 2d0f2fb865
commit 551056803d
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 27 additions and 6 deletions

View file

@ -1,5 +1,6 @@
use anyhow::{Context, Result};
use itertools::iproduct;
use serde::{Deserialize, Serialize};
use super::chunk::Chunk;
use crate::{
@ -7,7 +8,7 @@ use crate::{
types::*,
};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct BlockHeight(i32);
impl BlockHeight {
@ -25,7 +26,7 @@ impl BlockHeight {
}
}
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub struct BlockInfo {
block_type: BlockType,
y: BlockHeight,