aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/gamedata.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2018-07-07 03:41:40 +0200
committerDaniel Schadt <kingdread@gmx.de>2018-07-07 03:41:40 +0200
commitc1236e68f32511332c79d2195876eb51aaaa7c5e (patch)
treef59f1f038e35131dd1ebcb39d77932af15c16549 /src/statistics/gamedata.rs
parent32055313bd4ac5a9246ce92fd06156a370e14b17 (diff)
downloadevtclib-c1236e68f32511332c79d2195876eb51aaaa7c5e.tar.gz
evtclib-c1236e68f32511332c79d2195876eb51aaaa7c5e.tar.bz2
evtclib-c1236e68f32511332c79d2195876eb51aaaa7c5e.zip
more readability
Diffstat (limited to 'src/statistics/gamedata.rs')
-rw-r--r--src/statistics/gamedata.rs17
1 files changed, 17 insertions, 0 deletions
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,)* ], )* ) => {
&[