From 12dce406808620989646a163ff77a0782eb5ef63 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 13 Jun 2016 18:44:54 +0200 Subject: combat rounds --- src/Sequence/Utils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Sequence/Utils.hs') diff --git a/src/Sequence/Utils.hs b/src/Sequence/Utils.hs index dc6657a..513cb0b 100644 --- a/src/Sequence/Utils.hs +++ b/src/Sequence/Utils.hs @@ -61,7 +61,7 @@ withFocus f = use gFocus >>= maybe (shellPutErrLn $ "Currently not focusing any withFocus' :: (Entity -> Sh GameState a) -> Sh GameState (Maybe a) withFocus' f = preuse gFocus' >>= maybe (Nothing <$ shellPutErrLn "Currently not focusing any entity") (fmap Just . f) -focusState :: MonadState GameState m => Traversal' GameState a -> StateT a (MaybeT m) b -> m (Maybe b) +focusState :: MonadState s m => Traversal' s a -> StateT a (MaybeT m) b -> m (Maybe b) focusState lens action = runMaybeT $ uncurry (<$) . over _2 (lens .=) =<< runStateT action =<< MaybeT (preuse lens) unaligned = view faction' def -- cgit v1.2.3