use std::collections::HashMap; use ::serde::Deserialize; #[derive(Deserialize, Debug)] pub struct Item { pub name: String, pub renderable: Option, pub consumable: Option, pub weapon: Option, pub shield: Option, } #[derive(Deserialize, Debug)] pub struct Renderable { pub glyph: String, pub fg: String, pub bg: String, pub order: i32, } #[derive(Deserialize, Debug)] pub struct Consumable { pub effects: HashMap, } #[derive(Deserialize, Debug)] pub struct Weapon { pub range: String, pub attribute: String, pub base_damage: String, pub hit_bonus: i32, } #[derive(Deserialize, Debug)] pub struct Shield { pub defense_bonus: i32, }