artifacts-rs 1.5.1

Rust client for Artifacts
Documentation
use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
pub struct CharacterMultiFightResultSchema {
    /// Name of the character.
    #[serde(rename = "character_name")]
    pub character_name: String,
    /// XP gained by this character.
    #[serde(rename = "xp")]
    pub xp: i32,
    /// Gold gained by this character.
    #[serde(rename = "gold")]
    pub gold: i32,
    /// Items dropped for this character.
    #[serde(rename = "drops")]
    pub drops: Vec<models::DropSchema>,
    /// Character's HP at the end of combat.
    #[serde(rename = "final_hp")]
    pub final_hp: i32,
}

impl CharacterMultiFightResultSchema {
    pub fn new(
        character_name: String,
        xp: i32,
        gold: i32,
        drops: Vec<models::DropSchema>,
        final_hp: i32,
    ) -> CharacterMultiFightResultSchema {
        CharacterMultiFightResultSchema {
            character_name,
            xp,
            gold,
            drops,
            final_hp,
        }
    }
}