From c1236e68f32511332c79d2195876eb51aaaa7c5e Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sat, 7 Jul 2018 03:41:40 +0200 Subject: more readability --- src/statistics/gamedata.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/statistics/gamedata.rs') diff --git a/src/statistics/gamedata.rs b/src/statistics/gamedata.rs index 3bd895e..80f269e 100644 --- a/src/statistics/gamedata.rs +++ b/src/statistics/gamedata.rs @@ -113,6 +113,23 @@ pub enum Trigger { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Mechanic(pub u16, pub Trigger, pub &'static str); +impl Mechanic { + #[inline] + pub fn boss_id(&self) -> u16 { + self.0 + } + + #[inline] + pub fn trigger(&self) -> &Trigger { + &self.1 + } + + #[inline] + pub fn name(&self) -> &'static str { + self.2 + } +} + macro_rules! mechanics { ( $( $boss_id:expr => [ $($name:expr => $trigger:expr,)* ], )* ) => { &[ -- cgit v1.2.3