    -- | Semantics of human player commands.
    module Game.LambdaHack.Client.UI.HandleHumanM
      ( cmdSemInCxtOfKM, updateKeyLast
    #ifdef EXPOSE_INTERNAL
        -- * Internal operations
      , noRemoteHumanCmd, CmdLeaderNeed, cmdSemantics, cmdSemanticsLeader
      , addNoError, addLeader, weaveLeader
    #endif
      ) where

    import Prelude ()

    import Game.LambdaHack.Core.Prelude

    import           Game.LambdaHack.Client.MonadClient
    import           Game.LambdaHack.Client.Request
    import           Game.LambdaHack.Client.State
    import           Game.LambdaHack.Client.UI.HandleHelperM
    import           Game.LambdaHack.Client.UI.HandleHumanGlobalM
    import           Game.LambdaHack.Client.UI.HandleHumanLocalM
    import           Game.LambdaHack.Client.UI.HumanCmd
    import qualified Game.LambdaHack.Client.UI.Key as K
    import           Game.LambdaHack.Client.UI.MonadClientUI
    import           Game.LambdaHack.Client.UI.SessionUI
    import           Game.LambdaHack.Common.Types

    -- | Commands that are forbidden on a remote level, because they
    -- would usually take time when invoked on one, but not necessarily do
    -- what the player expects. Note that some commands that normally take time
    -- are not included, because they don't take time in aiming mode
    -- or their individual sanity conditions include a remote level check.
    noRemoteHumanCmd :: HumanCmd -> Bool
    noRemoteHumanCmd :: HumanCmd -> Bool
    noRemoteHumanCmd HumanCmd
    cmd = case HumanCmd
    cmd of
      HumanCmd
    Wait          -> Bool
    True
      HumanCmd
    Wait10        -> Bool
    True
      MoveItem{}    -> Bool
    True
      Apply{}       -> Bool
    True
      AlterDir{}    -> Bool
    True
      AlterWithPointer{} -> Bool
    True
      HumanCmd
    MoveOnceToXhair -> Bool
    True
      HumanCmd
    RunOnceToXhair -> Bool
    True
      HumanCmd
    ContinueToXhair -> Bool
    True
      HumanCmd
    _ -> Bool
    False

    updateKeyLast :: K.KM -> HumanCmd -> KeyMacroFrame -> KeyMacroFrame
    updateKeyLast :: KM -> HumanCmd -> KeyMacroFrame -> KeyMacroFrame
    updateKeyLast KM
    km HumanCmd
    cmd KeyMacroFrame
    macroFrame = case HumanCmd
    cmd of
      RepeatLast{} -> KeyMacroFrame
    macroFrame
      Record{} -> KeyMacroFrame
    macroFrame
      HumanCmd
    _ -> KeyMacroFrame
    macroFrame {keyLast = Just km}

    -- | The semantics of human player commands in terms of the client monad,
    -- in context of the given @km@ as the last action.
    --
    -- Some time cosuming commands are enabled even in aiming mode, but cannot be
    -- invoked in aiming mode on a remote level (level different than
    -- the level of the leader). Commands that require a pointman fail
    -- when no leader is designated.
    cmdSemInCxtOfKM :: (MonadClient m, MonadClientUI m)
                    => K.KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM :: forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM KM
    km HumanCmd
    cmd = do
      (SessionUI -> SessionUI) -> m ()
    forall (m :: * -> *).
    MonadClientUI m =>
    (SessionUI -> SessionUI) -> m ()
    modifySession ((SessionUI -> SessionUI) -> m ())
    -> (SessionUI -> SessionUI) -> m ()
    forall a b. (a -> b) -> a -> b
    $ \SessionUI
    sess ->
        SessionUI
    sess {smacroFrame = updateKeyLast km cmd $ smacroFrame sess}
      HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd

    data CmdLeaderNeed m =
        CmdNoNeed (m (Either MError ReqUI))
      | CmdLeader (ActorId -> m (Either MError ReqUI))

    cmdSemantics :: (MonadClient m, MonadClientUI m)
                 => HumanCmd -> m (Either MError ReqUI)
    cmdSemantics :: forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd = case HumanCmd -> CmdLeaderNeed m
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> CmdLeaderNeed m
    cmdSemanticsLeader HumanCmd
    cmd of
      CmdNoNeed m (Either MError ReqUI)
    mreq -> m (Either MError ReqUI)
    mreq
      CmdLeader ActorId -> m (Either MError ReqUI)
    f -> do
        mleader <- (StateClient -> Maybe ActorId) -> m (Maybe ActorId)
    forall a. (StateClient -> a) -> m a
    forall (m :: * -> *) a.
    MonadClientRead m =>
    (StateClient -> a) -> m a
    getsClient StateClient -> Maybe ActorId
    sleader
        case mleader of
          Maybe ActorId
    Nothing -> FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Text -> m (FailOrCmd ReqUI)
    forall (m :: * -> *) a. MonadClientUI m => Text -> m (FailOrCmd a)
    failWith
            Text
    "command disabled when no pointman designated, choose another command"
          Just ActorId
    leader -> do
            if HumanCmd -> Bool
    noRemoteHumanCmd HumanCmd
    cmd then do
              -- If in aiming mode, check if the current level is the same
              -- as player level and refuse performing the action otherwise.
              arena <- m LevelId
    forall (m :: * -> *). MonadClientUI m => m LevelId
    getArenaUI
              lidV <- viewedLevelUI
              if arena /= lidV then
                weaveJust <$> failWith
                  "command disabled on a remote level, press ESC to switch back"
              else f leader
            else ActorId -> m (Either MError ReqUI)
    f ActorId
    leader

    cmdSemanticsLeader :: (MonadClient m, MonadClientUI m)
                       => HumanCmd -> CmdLeaderNeed m
    cmdSemanticsLeader :: forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> CmdLeaderNeed m
    cmdSemanticsLeader HumanCmd
    cmd = case HumanCmd
    cmd of
      Macro [String]
    kms -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError (m () -> CmdLeaderNeed m) -> m () -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ [String] -> m ()
    forall (m :: * -> *). MonadClientUI m => [String] -> m ()
    macroHuman [String]
    kms
      ByArea [(CmdArea, HumanCmd)]
    l -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> [(CmdArea, HumanCmd)] -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> [(CmdArea, HumanCmd)] -> m (Either MError ReqUI)
    byAreaHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM [(CmdArea, HumanCmd)]
    l
      ByAimMode AimModeCmd{HumanCmd
    exploration :: HumanCmd
    aiming :: HumanCmd
    aiming :: AimModeCmd -> HumanCmd
    exploration :: AimModeCmd -> HumanCmd
    ..} ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m (Either MError ReqUI)
    -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    m (Either MError ReqUI)
    -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    byAimModeHuman (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    exploration) (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    aiming)
      ComposeIfLocal HumanCmd
    cmd1 HumanCmd
    cmd2 ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m (Either MError ReqUI)
    -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    m (Either MError ReqUI)
    -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    composeIfLocalHuman (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd1) (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd2)
      ComposeUnlessError HumanCmd
    cmd1 HumanCmd
    cmd2 ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m (Either MError ReqUI)
    -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    m (Either MError ReqUI)
    -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    composeUnlessErrorHuman (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd1) (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd2)
      Compose2ndLocal HumanCmd
    cmd1 HumanCmd
    cmd2 ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m (Either MError ReqUI)
    -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    m (Either MError ReqUI)
    -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    compose2ndLocalHuman (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd1) (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd2)
      LoopOnNothing HumanCmd
    cmd1 -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    m (Either MError ReqUI) -> m (Either MError ReqUI)
    loopOnNothingHuman (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd1)
      ExecuteIfClear HumanCmd
    cmd1 -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    m (Either MError ReqUI) -> m (Either MError ReqUI)
    executeIfClearHuman (HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    HumanCmd -> m (Either MError ReqUI)
    cmdSemantics HumanCmd
    cmd1)

      HumanCmd
    Wait -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> m (Either FailError RequestTimed)
    waitHuman ActorId
    leader
      HumanCmd
    Wait10 -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> m (Either FailError RequestTimed)
    waitHuman10 ActorId
    leader
      HumanCmd
    Yell -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> m (Either FailError RequestTimed)
    yellHuman ActorId
    leader
      MoveDir Vector
    v -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader ->
                     RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId
    -> Bool
    -> Bool
    -> Bool
    -> Bool
    -> Vector
    -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId
    -> Bool
    -> Bool
    -> Bool
    -> Bool
    -> Vector
    -> m (Either FailError RequestTimed)
    moveRunHuman ActorId
    leader Bool
    True Bool
    True Bool
    False Bool
    False Vector
    v
      RunDir Vector
    v -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader ->
                    RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId
    -> Bool
    -> Bool
    -> Bool
    -> Bool
    -> Vector
    -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId
    -> Bool
    -> Bool
    -> Bool
    -> Bool
    -> Vector
    -> m (Either FailError RequestTimed)
    moveRunHuman ActorId
    leader Bool
    True Bool
    True Bool
    True Bool
    True Vector
    v
      HumanCmd
    RunOnceAhead ->
        (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either MError RequestTimed) -> m (Either MError ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either MError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> m (Either MError RequestTimed)
    runOnceAheadHuman ActorId
    leader
      HumanCmd
    MoveOnceToXhair -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader ->
                           RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> m (Either FailError RequestTimed)
    moveOnceToXhairHuman ActorId
    leader
      HumanCmd
    RunOnceToXhair  -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader ->
                           RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> m (Either FailError RequestTimed)
    runOnceToXhairHuman ActorId
    leader
      HumanCmd
    ContinueToXhair -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader ->
                           RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> m (Either FailError RequestTimed)
    continueToXhairHuman ActorId
    leader
      MoveItem [CStore]
    stores CStore
    toCStore Maybe Text
    mverb Bool
    auto ->
        (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader ->
          RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId
    -> [CStore]
    -> CStore
    -> Maybe Text
    -> Bool
    -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId
    -> [CStore]
    -> CStore
    -> Maybe Text
    -> Bool
    -> m (Either FailError RequestTimed)
    moveItemHuman ActorId
    leader [CStore]
    stores CStore
    toCStore Maybe Text
    mverb Bool
    auto
      HumanCmd
    Project -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> m (Either FailError RequestTimed)
    projectHuman ActorId
    leader
      HumanCmd
    Apply -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> m (Either FailError RequestTimed)
    applyHuman ActorId
    leader
      HumanCmd
    AlterDir -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> m (Either FailError RequestTimed)
    alterDirHuman ActorId
    leader
      HumanCmd
    AlterWithPointer ->
        (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> m (Either FailError RequestTimed)
    alterWithPointerHuman ActorId
    leader
      HumanCmd
    CloseDir -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ((ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> RequestTimed -> ReqUI
    ReqUITimed (RequestTimed -> ReqUI)
    -> m (Either FailError RequestTimed) -> m (FailOrCmd ReqUI)
    forall (f :: * -> *) (g :: * -> *) a b.
    (Functor f, Functor g) =>
    (a -> b) -> f (g a) -> f (g b)
    <$$> ActorId -> m (Either FailError RequestTimed)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> m (Either FailError RequestTimed)
    closeDirHuman ActorId
    leader
      HumanCmd
    Help -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    helpHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    Hint -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    hintHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    ItemMenu -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> ActorId
    -> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId
    -> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    itemMenuHuman ActorId
    leader KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      ChooseItemMenu ItemDialogMode
    dialogMode ->
        (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> ActorId
    -> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> ItemDialogMode
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId
    -> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> ItemDialogMode
    -> m (Either MError ReqUI)
    chooseItemMenuHuman ActorId
    leader KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM ItemDialogMode
    dialogMode
      HumanCmd
    MainMenu -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    mainMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    MainMenuAutoOn -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    mainMenuAutoOnHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    MainMenuAutoOff -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    mainMenuAutoOffHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    Dashboard -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    dashboardHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      GameDifficultyIncr Int
    delta ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ Int -> m ()
    forall (m :: * -> *). MonadClient m => Int -> m ()
    gameDifficultyIncr Int
    delta m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    challengeMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    GameFishToggle ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m ()
    forall (m :: * -> *). MonadClient m => m ()
    gameFishToggle m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    challengeMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    GameGoodsToggle ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m ()
    forall (m :: * -> *). MonadClient m => m ()
    gameGoodsToggle m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    challengeMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    GameWolfToggle ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m ()
    forall (m :: * -> *). MonadClient m => m ()
    gameWolfToggle m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    challengeMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    GameKeeperToggle ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m ()
    forall (m :: * -> *). MonadClient m => m ()
    gameKeeperToggle m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    challengeMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      GameScenarioIncr Int
    delta ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ Int -> m ()
    forall (m :: * -> *). MonadClientUI m => Int -> m ()
    gameScenarioIncr Int
    delta m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    challengeMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM

      HumanCmd
    GameRestart -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> ExitStrategy -> m (FailOrCmd ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    ExitStrategy -> m (FailOrCmd ReqUI)
    gameExitWithHuman ExitStrategy
    Restart
      HumanCmd
    GameQuit -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> ExitStrategy -> m (FailOrCmd ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    ExitStrategy -> m (FailOrCmd ReqUI)
    gameExitWithHuman ExitStrategy
    Quit
      HumanCmd
    GameDrop -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (ReqUI -> FailOrCmd ReqUI) -> m ReqUI -> m (FailOrCmd ReqUI)
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap ReqUI -> FailOrCmd ReqUI
    forall a b. b -> Either a b
    Right m ReqUI
    forall (m :: * -> *). MonadClientUI m => m ReqUI
    gameDropHuman
      HumanCmd
    GameExit -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (ReqUI -> FailOrCmd ReqUI) -> m ReqUI -> m (FailOrCmd ReqUI)
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap ReqUI -> FailOrCmd ReqUI
    forall a b. b -> Either a b
    Right m ReqUI
    forall (m :: * -> *). Monad m => m ReqUI
    gameExitHuman
      HumanCmd
    GameSave -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (ReqUI -> FailOrCmd ReqUI) -> m ReqUI -> m (FailOrCmd ReqUI)
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap ReqUI -> FailOrCmd ReqUI
    forall a b. b -> Either a b
    Right m ReqUI
    forall (m :: * -> *). MonadClientUI m => m ReqUI
    gameSaveHuman
      HumanCmd
    Doctrine -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (FailOrCmd ReqUI)
    forall (m :: * -> *). MonadClientUI m => m (FailOrCmd ReqUI)
    doctrineHuman
      HumanCmd
    Automate -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (FailOrCmd ReqUI)
    forall (m :: * -> *). MonadClientUI m => m (FailOrCmd ReqUI)
    automateHuman
      HumanCmd
    AutomateToggle -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m (FailOrCmd ReqUI)
    forall (m :: * -> *). MonadClientUI m => m (FailOrCmd ReqUI)
    automateToggleHuman
      HumanCmd
    AutomateBack -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed m (Either MError ReqUI)
    forall (m :: * -> *). MonadClientUI m => m (Either MError ReqUI)
    automateBackHuman

      ChooseItem ItemDialogMode
    dialogMode ->
        (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> ActorId -> ItemDialogMode -> m MError
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> ItemDialogMode -> m MError
    chooseItemHuman ActorId
    leader ItemDialogMode
    dialogMode
      ChooseItemProject [TriggerItem]
    ts ->
        (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> ActorId -> [TriggerItem] -> m MError
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> [TriggerItem] -> m MError
    chooseItemProjectHuman ActorId
    leader [TriggerItem]
    ts
      ChooseItemApply [TriggerItem]
    ts ->
        (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> ActorId -> [TriggerItem] -> m MError
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> [TriggerItem] -> m MError
    chooseItemApplyHuman ActorId
    leader [TriggerItem]
    ts
      PickLeader Int
    k -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> m MError
    forall (m :: * -> *). MonadClientUI m => Int -> m MError
    pickLeaderHuman Int
    k
      HumanCmd
    PickLeaderWithPointer ->
        (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (m MError -> m (Either MError ReqUI))
    -> (ActorId -> m MError) -> ActorId -> m (Either MError ReqUI)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ActorId -> m MError
    forall (m :: * -> *). MonadClientUI m => ActorId -> m MError
    pickLeaderWithPointerHuman
      PointmanCycle Direction
    direction ->
        (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> ActorId -> Direction -> m MError
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> Direction -> m MError
    pointmanCycleHuman ActorId
    leader Direction
    direction
      PointmanCycleLevel Direction
    direction ->
        (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> ActorId -> Direction -> m MError
    forall (m :: * -> *).
    MonadClientUI m =>
    ActorId -> Direction -> m MError
    pointmanCycleLevelHuman ActorId
    leader Direction
    direction
      HumanCmd
    SelectActor -> (ActorId -> m ()) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m ()) -> CmdLeaderNeed m
    addLeader ActorId -> m ()
    forall (m :: * -> *). MonadClientUI m => ActorId -> m ()
    selectActorHuman
      HumanCmd
    SelectNone -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    selectNoneHuman
      HumanCmd
    SelectWithPointer -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m MError
    forall (m :: * -> *). MonadClientUI m => m MError
    selectWithPointerHuman
      Repeat Int
    n -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError (m () -> CmdLeaderNeed m) -> m () -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ Int -> m ()
    forall (m :: * -> *). MonadClientUI m => Int -> m ()
    repeatHuman Int
    n
      RepeatLast Int
    n -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError (m () -> CmdLeaderNeed m) -> m () -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ Int -> m ()
    forall (m :: * -> *). MonadClientUI m => Int -> m ()
    repeatLastHuman Int
    n
      HumanCmd
    Record -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    recordHuman
      HumanCmd
    AllHistory -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    allHistoryHuman
      MarkVision Int
    delta ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ Int -> m ()
    forall (m :: * -> *). MonadClientUI m => Int -> m ()
    markVisionHuman Int
    delta m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    settingsMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    MarkSmell ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    markSmellHuman m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    settingsMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      MarkSuspect Int
    delta ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ Int -> m ()
    forall (m :: * -> *). MonadClient m => Int -> m ()
    markSuspectHuman Int
    delta m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    settingsMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    MarkAnim ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m ()
    forall (m :: * -> *). MonadClient m => m ()
    markAnimHuman m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    settingsMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      OverrideTut Int
    delta ->
        m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ Int -> m ()
    forall (m :: * -> *). MonadClientUI m => Int -> m ()
    overrideTutHuman Int
    delta m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    settingsMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    SettingsMenu -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    settingsMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    ChallengeMenu -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    forall (m :: * -> *).
    MonadClientUI m =>
    (KM -> HumanCmd -> m (Either MError ReqUI))
    -> m (Either MError ReqUI)
    challengeMenuHuman KM -> HumanCmd -> m (Either MError ReqUI)
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    KM -> HumanCmd -> m (Either MError ReqUI)
    cmdSemInCxtOfKM
      HumanCmd
    PrintScreen -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    printScreenHuman

      HumanCmd
    Cancel -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    cancelHuman
      HumanCmd
    Accept -> (ActorId -> m ()) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m ()) -> CmdLeaderNeed m
    addLeader ActorId -> m ()
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> m ()
    acceptHuman
      HumanCmd
    DetailCycle -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    detailCycleHuman
      HumanCmd
    ClearTargetIfItemClear -> (ActorId -> m ()) -> CmdLeaderNeed m
    forall (m :: * -> *).
    Monad m =>
    (ActorId -> m ()) -> CmdLeaderNeed m
    addLeader ActorId -> m ()
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> m ()
    clearTargetIfItemClearHuman
      HumanCmd
    ItemClear -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    itemClearHuman
      MoveXhair Vector
    v Int
    k -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Vector -> Int -> m MError
    forall (m :: * -> *). MonadClientUI m => Vector -> Int -> m MError
    moveXhairHuman Vector
    v Int
    k
      HumanCmd
    AimTgt -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    aimTgtHuman
      HumanCmd
    AimFloor -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    aimFloorHuman
      HumanCmd
    AimEnemy -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    aimEnemyHuman
      HumanCmd
    AimItem -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    aimItemHuman
      AimAscend Int
    k -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> m MError
    forall (m :: * -> *). MonadClientUI m => Int -> m MError
    aimAscendHuman Int
    k
      EpsIncr Direction
    b -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError (m () -> CmdLeaderNeed m) -> m () -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ Direction -> m ()
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    Direction -> m ()
    epsIncrHuman Direction
    b
      HumanCmd
    XhairUnknown -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (m MError -> m (Either MError ReqUI))
    -> (ActorId -> m MError) -> ActorId -> m (Either MError ReqUI)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ActorId -> m MError
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> m MError
    xhairUnknownHuman
      HumanCmd
    XhairItem -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (m MError -> m (Either MError ReqUI))
    -> (ActorId -> m MError) -> ActorId -> m (Either MError ReqUI)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ActorId -> m MError
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> m MError
    xhairItemHuman
      XhairStair Bool
    up -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left (MError -> Either MError ReqUI)
    -> m MError -> m (Either MError ReqUI)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> ActorId -> Bool -> m MError
    forall (m :: * -> *).
    (MonadClient m, MonadClientUI m) =>
    ActorId -> Bool -> m MError
    xhairStairHuman ActorId
    leader Bool
    up
      HumanCmd
    XhairPointerFloor -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    xhairPointerFloorHuman
      HumanCmd
    XhairPointerMute -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    xhairPointerMuteHuman
      HumanCmd
    XhairPointerEnemy -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    xhairPointerEnemyHuman
      HumanCmd
    AimPointerFloor -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    aimPointerFloorHuman
      HumanCmd
    AimPointerEnemy -> m () -> CmdLeaderNeed m
    forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    forall (m :: * -> *). MonadClientUI m => m ()
    aimPointerEnemyHuman

    addNoError :: Monad m => m () -> CmdLeaderNeed m
    addNoError :: forall (m :: * -> *). Monad m => m () -> CmdLeaderNeed m
    addNoError m ()
    cmdCli = m (Either MError ReqUI) -> CmdLeaderNeed m
    forall (m :: * -> *). m (Either MError ReqUI) -> CmdLeaderNeed m
    CmdNoNeed (m (Either MError ReqUI) -> CmdLeaderNeed m)
    -> m (Either MError ReqUI) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ m ()
    cmdCli m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> Either MError ReqUI -> m (Either MError ReqUI)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left MError
    forall a. Maybe a
    Nothing)

    addLeader :: Monad m => (ActorId -> m ()) -> CmdLeaderNeed m
    addLeader :: forall (m :: * -> *).
    Monad m =>
    (ActorId -> m ()) -> CmdLeaderNeed m
    addLeader ActorId -> m ()
    cmdCli =
      (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ \ActorId
    leader -> ActorId -> m ()
    cmdCli ActorId
    leader m () -> m (Either MError ReqUI) -> m (Either MError ReqUI)
    forall a b. m a -> m b -> m b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> Either MError ReqUI -> m (Either MError ReqUI)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (MError -> Either MError ReqUI
    forall a b. a -> Either a b
    Left MError
    forall a. Maybe a
    Nothing)

    weaveLeader :: Monad m => (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader :: forall (m :: * -> *).
    Monad m =>
    (ActorId -> m (FailOrCmd ReqUI)) -> CmdLeaderNeed m
    weaveLeader ActorId -> m (FailOrCmd ReqUI)
    cmdCli = (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall (m :: * -> *).
    (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    CmdLeader ((ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m)
    -> (ActorId -> m (Either MError ReqUI)) -> CmdLeaderNeed m
    forall a b. (a -> b) -> a -> b
    $ (FailOrCmd ReqUI -> Either MError ReqUI)
    -> m (FailOrCmd ReqUI) -> m (Either MError ReqUI)
    forall a b. (a -> b) -> m a -> m b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap FailOrCmd ReqUI -> Either MError ReqUI
    forall a. FailOrCmd a -> Either MError a
    weaveJust (m (FailOrCmd ReqUI) -> m (Either MError ReqUI))
    -> (ActorId -> m (FailOrCmd ReqUI))
    -> ActorId
    -> m (Either MError ReqUI)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ActorId -> m (FailOrCmd ReqUI)
    cmdCli