packages feed

werewolf 0.4.1.1 → 0.4.1.2

raw patch · 3 files changed

+51/−1 lines, 3 files

Files

CHANGELOG.md view
@@ -2,6 +2,12 @@  #### Upcoming +#### v0.4.1.2++*Revisions*++* Added missing module to Cabal file.+ #### v0.4.1.1  *Revisions*
+ app/Werewolf/Commands/Heal.hs view
@@ -0,0 +1,43 @@+{-|+Module      : Werewolf.Commands.Heal+Description : Handler for the heal subcommand.++Copyright   : (c) Henry J. Wylde, 2015+License     : BSD3+Maintainer  : public@hjwylde.com++Handler for the heal subcommand.+-}++{-# LANGUAGE OverloadedStrings #-}++module Werewolf.Commands.Heal (+    -- * Handle+    handle,+) where++import Control.Monad.Except+import Control.Monad.Extra+import Control.Monad.State+import Control.Monad.Writer++import Data.Text (Text)++import Game.Werewolf.Command+import Game.Werewolf.Engine+import Game.Werewolf.Response++-- | Handle.+handle :: MonadIO m => Text -> m ()+handle callerName = do+    unlessM doesGameExist $ exitWith failure {+        messages = [noGameRunningMessage callerName]+        }++    game <- readGame++    let command = healCommand callerName++    case runExcept (runWriterT $ execStateT (apply command >> checkStage >> checkGameOver) game) of+        Left errorMessages      -> exitWith failure { messages = errorMessages }+        Right (game', messages) -> writeGame game' >> exitWith success { messages = messages }
werewolf.cabal view
@@ -1,5 +1,5 @@ name:           werewolf-version:        0.4.1.1+version:        0.4.1.2  author:         Henry J. Wylde maintainer:     public@hjwylde.com@@ -29,6 +29,7 @@     ghc-options:    -threaded -with-rtsopts=-N     other-modules:         Werewolf.Commands.End,+        Werewolf.Commands.Heal,         Werewolf.Commands.Help,         Werewolf.Commands.Interpret,         Werewolf.Commands.Pass,