1
0
Fork 0
roguelike-game/src/components/serialize.rs

23 lines
608 B
Rust

use ::serde::{Deserialize, Serialize};
use ::specs::prelude::*;
use ::specs_derive::*;
use crate::map::{Map, MasterDungeonMap};
// Serialization helper code. We need to implement ConvertSaveLoad for each type that contains an
// Entity.
pub struct SerializeMe;
// Special component that exists to help serialize the game data
#[derive(Component, Serialize, Deserialize, Clone)]
pub struct SerializationHelper {
pub map: Map,
}
#[derive(Component, Serialize, Deserialize, Clone)]
pub struct DMSerializationHelper {
pub map: MasterDungeonMap,
pub log: Vec<Vec<crate::gamelog::LogFragment>>,
}