summaryrefslogtreecommitdiff
path: root/src/Sequence
diff options
context:
space:
mode:
Diffstat (limited to 'src/Sequence')
-rw-r--r--src/Sequence/Types.hs2
-rw-r--r--src/Sequence/Utils.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Sequence/Types.hs b/src/Sequence/Types.hs
index 59397d5..4aa55d3 100644
--- a/src/Sequence/Types.hs
+++ b/src/Sequence/Types.hs
@@ -159,4 +159,4 @@ gRounds' :: Getter GameState [Int]
159gRounds' = to $ nub . sort . toListOf gRounds 159gRounds' = to $ nub . sort . toListOf gRounds
160 160
161gRound :: Getter GameState Int 161gRound :: Getter GameState Int
162gRound = to $ getMin . (<> Min 0) . view (gRounds . _Unwrapped) 162gRound = to $ fromMaybe 0 . minimumOf gRounds
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
61withFocus' :: (Entity -> Sh GameState a) -> Sh GameState (Maybe a) 61withFocus' :: (Entity -> Sh GameState a) -> Sh GameState (Maybe a)
62withFocus' f = preuse gFocus' >>= maybe (Nothing <$ shellPutErrLn "Currently not focusing any entity") (fmap Just . f) 62withFocus' f = preuse gFocus' >>= maybe (Nothing <$ shellPutErrLn "Currently not focusing any entity") (fmap Just . f)
63 63
64focusState :: MonadState GameState m => Traversal' GameState a -> StateT a (MaybeT m) b -> m (Maybe b) 64focusState :: MonadState s m => Traversal' s a -> StateT a (MaybeT m) b -> m (Maybe b)
65focusState lens action = runMaybeT $ uncurry (<$) . over _2 (lens .=) =<< runStateT action =<< MaybeT (preuse lens) 65focusState lens action = runMaybeT $ uncurry (<$) . over _2 (lens .=) =<< runStateT action =<< MaybeT (preuse lens)
66 66
67unaligned = view faction' def 67unaligned = view faction' def