artifacts/models/
give_gold_data_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 GiveGoldDataSchema {
7 #[serde(rename = "cooldown")]
9 pub cooldown: Box<models::CooldownSchema>,
10 #[serde(rename = "quantity")]
12 pub quantity: u32,
13 #[serde(rename = "receiver_character")]
15 pub receiver_character: Box<models::CharacterSchema>,
16 #[serde(rename = "character")]
18 pub character: Box<models::CharacterSchema>,
19}
20
21impl GiveGoldDataSchema {
22 pub fn new(
23 cooldown: models::CooldownSchema,
24 quantity: u32,
25 receiver_character: models::CharacterSchema,
26 character: models::CharacterSchema,
27 ) -> GiveGoldDataSchema {
28 GiveGoldDataSchema {
29 cooldown: Box::new(cooldown),
30 quantity,
31 receiver_character: Box::new(receiver_character),
32 character: Box::new(character),
33 }
34 }
35}
36
37impl crate::traits::GetCooldown for GiveGoldDataSchema {
38 fn get_cooldown(&self) -> &crate::models::CooldownSchema {
39 &self.cooldown
40 }
41}
42
43impl crate::traits::GetCharacter for GiveGoldDataSchema {
44 fn get_character(&self) -> &crate::models::CharacterSchema {
45 &self.character
46 }
47}