skyblock_repo/models/
npc.rs1#[cfg(feature = "python")]
2use pyo3::{pyclass, pymethods};
3use serde::{Deserialize, Serialize};
4#[cfg(feature = "python")]
5use skyblock_repo_macros::PyStr;
6
7use crate::models::Coordinates;
8
9#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
10#[serde(rename_all = "camelCase")]
11#[cfg_attr(feature = "python", pyclass, derive(PyStr))]
12pub struct SkyblockNpc {
13 #[serde(default)]
14 pub internal_id: String,
15 pub name: Option<String>,
16 pub flags: Option<NpcFlags>,
17 pub location: Option<NpcLocation>,
18 pub visitor: Option<NpcGardenVisitor>,
19}
20
21#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
22#[cfg_attr(feature = "python", pyclass, derive(PyStr))]
23pub struct NpcFlags {
24 pub merchant: bool,
25 pub abiphone: bool,
26 pub garden: bool,
27 pub shop: bool,
28}
29
30#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
31#[serde(rename_all = "camelCase")]
32#[cfg_attr(feature = "python", pyclass, derive(PyStr))]
33pub struct NpcLocation {
34 pub zone: Option<String>,
35 pub coordinates: Option<Coordinates>,
36}
37
38#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
39#[serde(rename_all = "camelCase")]
40#[cfg_attr(feature = "python", pyclass, derive(PyStr))]
41pub struct NpcGardenVisitor {
42 pub rarity: String,
43 pub garden_level: u8,
44 pub desire: Option<String>,
45 pub bonus: Option<String>,
46 pub copper: Option<f64>,
47 pub farming_xp: Option<f64>,
48}