From 0802edda630246a0ff9f82196e55f09780ffa965 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 12 Jun 2016 03:44:53 +0200 Subject: Armour --- src/Sequence/Utils.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Sequence/Utils.hs') 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 hitzones <- Set.map (view _Hitzone) . Map.keysSet <$> MaybeT (preuse $ gFocus' . eStats . sHitzones) guard (hasGlob || ws `Set.isSubsetOf` hitzones) return . Set.map (review _Hitzone) $ if hasGlob then hitzones else ws + +instance Completion DamageType GameState where + completableLabel _ = "" + complete _ _ prefix = return . filter ((isPrefixOf `on` CI.foldCase) prefix) $ map show ([minBound .. maxBound] :: [DamageType]) + +instance Argument DamageType GameState where + arg (CI.mk -> word) = return $ Map.lookup word types + where + types = Map.fromList [(CI.mk $ show dType, dType) | dType <- [minBound .. maxBound]] -- cgit v1.2.3