rust-rl/src/raws/item_structs.rs
2023-08-13 20:16:24 +01:00

34 lines
703 B
Rust

use serde::Deserialize;
use std::collections::HashMap;
#[derive(Deserialize, Debug)]
pub struct Item {
pub id: String,
pub name: Name,
pub renderable: Option<Renderable>,
pub weight: Option<f32>,
pub value: Option<f32>,
pub flags: Option<Vec<String>>,
pub effects: Option<HashMap<String, String>>,
pub magic: Option<MagicItem>,
}
#[derive(Deserialize, Debug)]
pub struct Name {
pub name: String,
pub plural: String,
}
#[derive(Deserialize, Debug)]
pub struct Renderable {
pub glyph: String,
pub fg: String,
pub bg: String,
pub order: i32,
}
#[derive(Deserialize, Debug)]
pub struct MagicItem {
pub class: String,
pub naming: String,
}