diff options
Diffstat (limited to 'src/command.rs')
-rw-r--r-- | src/command.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/command.rs b/src/command.rs index c0315db..4428b4d 100644 --- a/src/command.rs +++ b/src/command.rs @@ -53,3 +53,21 @@ impl fmt::Display for Action { } } } + +impl Action { + pub fn is_attack(&self) -> bool { + use Action::*; + match self { + Shoot(_) | Bomb(_) => true, + _ => false, + } + } + + pub fn is_snowball(&self) -> bool { + use Action::*; + match self { + Snowball(_) => true, + _ => false, + } + } +} |