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