Skip to main content

wowlab_types/types/data/
spec.rs

1use compact_str::CompactString;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Debug, Deserialize, Serialize)]
5#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
6pub struct SpecDataFlat {
7    pub id: i32,
8    #[cfg_attr(feature = "schema", schemars(with = "String"))]
9    pub name: CompactString,
10    pub description: String,
11    pub class_id: i32,
12    #[cfg_attr(feature = "schema", schemars(with = "String"))]
13    pub class_name: CompactString,
14    pub role: i32,
15    pub order_index: i32,
16    pub icon_file_id: i32,
17    #[cfg_attr(feature = "schema", schemars(with = "String"))]
18    pub file_name: CompactString,
19    pub primary_stat_priority: i32,
20    pub mastery_spell_id_0: i32,
21    pub mastery_spell_id_1: i32,
22}
23
24impl Default for SpecDataFlat {
25    fn default() -> Self {
26        Self {
27            id: 0,
28            name: CompactString::default(),
29            description: String::new(),
30            class_id: 0,
31            class_name: CompactString::default(),
32            role: 0,
33            order_index: 0,
34            icon_file_id: 0,
35            file_name: CompactString::const_new(crate::constants::DEFAULT_ICON_FILENAME),
36            primary_stat_priority: 0,
37            mastery_spell_id_0: 0,
38            mastery_spell_id_1: 0,
39        }
40    }
41}