skyblock_repo/models/
pet.rs1use std::collections::HashMap;
2
3#[cfg(feature = "python")]
4use pyo3::{pyclass, pymethods};
5use serde::{Deserialize, Serialize};
6#[cfg(feature = "python")]
7use skyblock_repo_macros::PyStr;
8
9use crate::UpgradeCost;
10
11#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
12#[serde(rename_all = "camelCase")]
13#[cfg_attr(feature = "python", pyclass, derive(PyStr))]
14pub struct SkyblockPet {
15 pub internal_id: String,
16 pub name: Option<String>,
17 pub category: Option<String>,
18 pub source: Option<String>,
19 pub min_level: u8,
20 pub max_level: u8,
21 pub base_stats: Vec<String>,
22 pub pet_flags: Option<PetFlags>,
23 pub rarities: HashMap<String, PetRarity>,
24}
25
26#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
27#[serde(rename_all = "snake_case")]
28#[cfg_attr(feature = "python", pyclass, derive(PyStr))]
29pub struct PetFlags {
30 pub auctionable: bool,
31 pub mountable: bool,
32 pub tradable: bool,
33 pub museumable: bool,
34}
35
36#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
37#[serde(rename_all = "camelCase")]
38#[cfg_attr(feature = "python", pyclass, derive(PyStr))]
39pub struct PetRarity {
40 pub lore: HashMap<String, String>,
41 pub value: Option<f64>,
42 #[serde(default)]
43 pub kat_upgradeable: bool,
44 #[serde(default)]
45 pub kat_upgrade_costs: Vec<UpgradeCost>,
46 pub kat_upgrade_seconds: Option<u32>,
47 pub kat_upgrade_time: Option<String>,
48}