mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-06 23:59: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
|
@ -5,6 +5,7 @@ use std::{
|
|||
};
|
||||
|
||||
use itertools::iproduct;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
macro_rules! coord_impl {
|
||||
($t:ident, $max:expr) => {
|
||||
|
@ -55,7 +56,7 @@ impl Debug for LayerBlockCoords {
|
|||
/// Generic array for data stored per block of a chunk layer
|
||||
///
|
||||
/// Includes various convenient iteration functions.
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
|
||||
pub struct LayerBlockArray<T>(pub [[T; BLOCKS_PER_CHUNK]; BLOCKS_PER_CHUNK]);
|
||||
|
||||
impl<T> LayerBlockArray<T> {
|
||||
|
@ -146,7 +147,7 @@ impl Debug for ChunkCoords {
|
|||
/// Generic array for data stored per chunk of a region
|
||||
///
|
||||
/// Includes various convenient iteration functions.
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
|
||||
pub struct ChunkArray<T>(pub [[T; CHUNKS_PER_REGION]; CHUNKS_PER_REGION]);
|
||||
|
||||
impl<T> ChunkArray<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue