artifacts/models/
character_transition_data_schema.rs

1use 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 CharacterTransitionDataSchema {
7    /// Cooldown details
8    #[serde(rename = "cooldown")]
9    pub cooldown: Box<models::CooldownSchema>,
10    /// Destination map details.
11    #[serde(rename = "destination")]
12    pub destination: Box<models::MapSchema>,
13    /// Transition details.
14    #[serde(rename = "transition")]
15    pub transition: Box<models::TransitionSchema>,
16    /// Character details.
17    #[serde(rename = "character")]
18    pub character: Box<models::CharacterSchema>,
19}
20
21impl CharacterTransitionDataSchema {
22    pub fn new(
23        cooldown: models::CooldownSchema,
24        destination: models::MapSchema,
25        transition: models::TransitionSchema,
26        character: models::CharacterSchema,
27    ) -> CharacterTransitionDataSchema {
28        CharacterTransitionDataSchema {
29            cooldown: Box::new(cooldown),
30            destination: Box::new(destination),
31            transition: Box::new(transition),
32            character: Box::new(character),
33        }
34    }
35}
36
37impl crate::traits::GetCooldown for CharacterTransitionDataSchema {
38    fn get_cooldown(&self) -> &crate::models::CooldownSchema {
39        &self.cooldown
40    }
41}
42
43impl crate::traits::GetCharacter for CharacterTransitionDataSchema {
44    fn get_character(&self) -> &crate::models::CharacterSchema {
45        &self.character
46    }
47}