artifacts/models/
character_stats_schema.rs1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5#[cfg_attr(feature = "specta", derive(specta::Type))]
6pub struct CharacterStatsSchema {
7 #[serde(rename = "monsters_killed", skip_serializing_if = "Option::is_none")]
8 #[cfg_attr(feature = "specta", specta(type = Option<specta_util::Unknown>))]
9 pub monsters_killed: Option<std::collections::HashMap<String, i32>>,
10 #[serde(rename = "resources_gathered", skip_serializing_if = "Option::is_none")]
11 #[cfg_attr(feature = "specta", specta(type = Option<specta_util::Unknown>))]
12 pub resources_gathered: Option<std::collections::HashMap<String, i32>>,
13 #[serde(rename = "items_crafted", skip_serializing_if = "Option::is_none")]
14 #[cfg_attr(feature = "specta", specta(type = Option<specta_util::Unknown>))]
15 pub items_crafted: Option<std::collections::HashMap<String, i32>>,
16 #[serde(rename = "action_counts", skip_serializing_if = "Option::is_none")]
17 #[cfg_attr(feature = "specta", specta(type = Option<specta_util::Unknown>))]
18 pub action_counts: Option<std::collections::HashMap<String, i32>>,
19 #[serde(rename = "deaths", skip_serializing_if = "Option::is_none")]
20 pub deaths: Option<i32>,
21}
22
23impl CharacterStatsSchema {
24 pub fn new() -> CharacterStatsSchema {
25 CharacterStatsSchema {
26 monsters_killed: None,
27 resources_gathered: None,
28 items_crafted: None,
29 action_counts: None,
30 deaths: None,
31 }
32 }
33}