mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-04 06:39:07 +02:00
Add Serialize/Deserialize impls to various types
We want to be able to store this data to disk temporarily.
This commit is contained in:
parent
2d0f2fb865
commit
551056803d
3 changed files with 27 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue