aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Spear/Game.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Spear/Game.hs b/Spear/Game.hs
index 6bb1fa6..cf33ccb 100644
--- a/Spear/Game.hs
+++ b/Spear/Game.hs
@@ -15,6 +15,8 @@ module Spear.Game
15 -- * Running and IO 15 -- * Running and IO
16, runGame 16, runGame
17, runGame' 17, runGame'
18, runSubGame
19, runSubGame'
18, evalSubGame 20, evalSubGame
19, execSubGame 21, execSubGame
20, gameIO 22, gameIO
@@ -75,6 +77,14 @@ runGame game state = runErrorT . R.runResourceT . runStateT game $ state
75runGame' :: Game s a -> s -> IO () 77runGame' :: Game s a -> s -> IO ()
76runGame' game state = runGame game state >> return () 78runGame' game state = runGame game state >> return ()
77 79
80-- | Run the given game.
81runSubGame :: Game s a -> s -> Game t (a,s)
82runSubGame game state = lift $ runStateT game state
83
84-- | Run the given game.
85runSubGame' :: Game s a -> s -> Game t ()
86runSubGame' game state = runSubGame game state >> return ()
87
78-- | Run the given game and return its result. 88-- | Run the given game and return its result.
79evalSubGame :: Game s a -> s -> Game t a 89evalSubGame :: Game s a -> s -> Game t a
80evalSubGame g s = lift $ evalStateT g s 90evalSubGame g s = lift $ evalStateT g s