wowlab_engine_domain/dbc/semantics/
aura_states.rs1#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
3#[repr(i32)]
4#[non_exhaustive]
5pub enum AuraState {
6 Defensive = 1,
7 Wounded20 = 2,
8 Unbalanced = 3,
9 Frozen = 4,
10 Marked = 5,
11 Wounded25 = 6,
12 Defensive2 = 7,
13 Banished = 8,
14 Dazed = 9,
15 Victorious = 10,
16 Rampage = 11,
17 FaerieFire = 12,
18 Wounded35 = 13,
19 RaidEncounter2 = 14,
20 DruidPeriodicHeal = 15,
21 RoguePoisoned = 16,
22 Enraged = 17,
23 Bleeding = 18,
24 Vulnerable = 19,
25 ArenaPreparation = 20,
26 WoundHealth20OrAbove80 = 21,
27 RaidEncounter = 22,
28 Healthy75 = 23,
29 WoundHealth35OrAbove80 = 24,
30 Wounded50 = 25,
31}
32
33impl AuraState {
34 pub const ALL: [Self; 25] = [
35 Self::Defensive,
36 Self::Wounded20,
37 Self::Unbalanced,
38 Self::Frozen,
39 Self::Marked,
40 Self::Wounded25,
41 Self::Defensive2,
42 Self::Banished,
43 Self::Dazed,
44 Self::Victorious,
45 Self::Rampage,
46 Self::FaerieFire,
47 Self::Wounded35,
48 Self::RaidEncounter2,
49 Self::DruidPeriodicHeal,
50 Self::RoguePoisoned,
51 Self::Enraged,
52 Self::Bleeding,
53 Self::Vulnerable,
54 Self::ArenaPreparation,
55 Self::WoundHealth20OrAbove80,
56 Self::RaidEncounter,
57 Self::Healthy75,
58 Self::WoundHealth35OrAbove80,
59 Self::Wounded50,
60 ];
61
62 #[must_use]
63 pub fn from_dbc(raw: i32) -> Option<Self> {
64 let index = usize::try_from(raw.checked_sub(1)?).ok()?;
65
66 Self::ALL.get(index).copied()
67 }
68
69 #[must_use]
70 pub const fn dbc(self) -> i32 {
71 self as i32
72 }
73}