use serde::Deserialize;

template_id!(Weapon item_id);

#[derive(Deserialize, Debug)]
#[serde(rename_all = "PascalCase")]
pub struct WeaponTemplate {
    #[serde(rename = "ItemID")]
    pub item_id: WeaponID,
    pub code_name: String,
    #[serde(rename = "Type")]
    pub weapon_type: u32,
    pub base_property: IntPropertyIntValue,
    pub rand_property: IntPropertyIntValue,
    pub star_limit: u32,
    pub exp_recycle: u32,
    pub refine_costs: Vec<IntItemIDIntNumber>,
    pub refine_initial: u32,
    pub refine_limit: u32,
}

// nice names, mihoyo
#[derive(Deserialize, Debug)]
#[serde(rename_all = "PascalCase")]
pub struct IntPropertyIntValue {
    pub property: u32,
    pub value: i32,
}

#[derive(Deserialize, Debug)]
#[serde(rename_all = "PascalCase")]
pub struct IntItemIDIntNumber {
    #[serde(rename = "ItemID")]
    pub item_id: u32,
    pub number: u32,
}
