summaryrefslogtreecommitdiff
path: root/src/Sequence/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Sequence/Utils.hs')
-rw-r--r--src/Sequence/Utils.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Sequence/Utils.hs b/src/Sequence/Utils.hs
index 1b52630..dc6657a 100644
--- a/src/Sequence/Utils.hs
+++ b/src/Sequence/Utils.hs
@@ -131,3 +131,12 @@ instance Argument (Set Hitzone) GameState where
131 hitzones <- Set.map (view _Hitzone) . Map.keysSet <$> MaybeT (preuse $ gFocus' . eStats . sHitzones) 131 hitzones <- Set.map (view _Hitzone) . Map.keysSet <$> MaybeT (preuse $ gFocus' . eStats . sHitzones)
132 guard (hasGlob || ws `Set.isSubsetOf` hitzones) 132 guard (hasGlob || ws `Set.isSubsetOf` hitzones)
133 return . Set.map (review _Hitzone) $ if hasGlob then hitzones else ws 133 return . Set.map (review _Hitzone) $ if hasGlob then hitzones else ws
134
135instance Completion DamageType GameState where
136 completableLabel _ = "<damageType>"
137 complete _ _ prefix = return . filter ((isPrefixOf `on` CI.foldCase) prefix) $ map show ([minBound .. maxBound] :: [DamageType])
138
139instance Argument DamageType GameState where
140 arg (CI.mk -> word) = return $ Map.lookup word types
141 where
142 types = Map.fromList [(CI.mk $ show dType, dType) | dType <- [minBound .. maxBound]]