summaryrefslogtreecommitdiff
path: root/src/Sequence/Utils.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-06-12 03:44:53 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-06-12 03:44:53 +0200
commit0802edda630246a0ff9f82196e55f09780ffa965 (patch)
treefe85c33b11afd69fa4ead5cba7a74c18b092ca9a /src/Sequence/Utils.hs
parentbf24ff9ffd25841da5e20386548fb63ff191ed9a (diff)
download2017-01-16_17:13:37-0802edda630246a0ff9f82196e55f09780ffa965.tar
2017-01-16_17:13:37-0802edda630246a0ff9f82196e55f09780ffa965.tar.gz
2017-01-16_17:13:37-0802edda630246a0ff9f82196e55f09780ffa965.tar.bz2
2017-01-16_17:13:37-0802edda630246a0ff9f82196e55f09780ffa965.tar.xz
2017-01-16_17:13:37-0802edda630246a0ff9f82196e55f09780ffa965.zip
Armour
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]]