packages feed

werewolf 0.4.3.0 → 0.4.3.1

raw patch · 3 files changed

+64/−2 lines, 3 files

Files

CHANGELOG.md view
@@ -2,12 +2,24 @@  #### Upcoming -#### v0.4.3+#### v0.4.3.1 +*Revisions*++* Added missing module to Cabal file.++#### v0.4.3.0+ *Minor*  * Added the Defender role. ([#38](https://github.com/hjwylde/werewolf/issues/38)) +#### v0.4.2.2++*Revisions*++* Added missing module to Cabal file.+ #### v0.4.2.1  *Revisions*@@ -19,6 +31,12 @@ *Minor*  * Added the Villager-Villager role. ([#37](https://github.com/hjwylde/werewolf/issues/37))++#### v0.4.1.2++*Revisions*++* Added missing module to Cabal file.  #### v0.4.1.1 
+ 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.3.0+version:        0.4.3.1  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,