Skip to main content

artifacts/models/
achievement_type.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
5#[cfg_attr(feature = "specta", derive(specta::Type))]
6#[derive(Default)]
7pub enum AchievementType {
8    #[serde(rename = "combat_kill")]
9    #[default]
10    CombatKill,
11    #[serde(rename = "combat_drop")]
12    CombatDrop,
13    #[serde(rename = "combat_level")]
14    CombatLevel,
15    #[serde(rename = "gathering")]
16    Gathering,
17    #[serde(rename = "crafting")]
18    Crafting,
19    #[serde(rename = "recycling")]
20    Recycling,
21    #[serde(rename = "task")]
22    Task,
23    #[serde(rename = "other")]
24    Other,
25    #[serde(rename = "use")]
26    Use,
27    #[serde(rename = "npc_buy")]
28    NpcBuy,
29    #[serde(rename = "npc_sell")]
30    NpcSell,
31}
32
33impl std::fmt::Display for AchievementType {
34    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35        match self {
36            Self::CombatKill => write!(f, "combat_kill"),
37            Self::CombatDrop => write!(f, "combat_drop"),
38            Self::CombatLevel => write!(f, "combat_level"),
39            Self::Gathering => write!(f, "gathering"),
40            Self::Crafting => write!(f, "crafting"),
41            Self::Recycling => write!(f, "recycling"),
42            Self::Task => write!(f, "task"),
43            Self::Other => write!(f, "other"),
44            Self::Use => write!(f, "use"),
45            Self::NpcBuy => write!(f, "npc_buy"),
46            Self::NpcSell => write!(f, "npc_sell"),
47        }
48    }
49}