diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-04-11 01:48:55 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-04-11 01:48:55 +0200 |
commit | b694c7705eab500bd2d0b28b09b04e22c223c571 (patch) | |
tree | 4024fdb2860e5aa5de4e77850da4daa60499cbeb /src/MainLoop.hs | |
parent | d2be8eb4103f266eb2078135960779bcbb82c492 (diff) | |
download | htanks-b694c7705eab500bd2d0b28b09b04e22c223c571.tar htanks-b694c7705eab500bd2d0b28b09b04e22c223c571.zip |
Removed IO from Game monad
Diffstat (limited to 'src/MainLoop.hs')
-rw-r--r-- | src/MainLoop.hs | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/MainLoop.hs b/src/MainLoop.hs index 0ebaa53..a484435 100644 --- a/src/MainLoop.hs +++ b/src/MainLoop.hs @@ -1,8 +1,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} module MainLoop ( MainState(..) - , MainT(..) - , Main + , Main(..) , runMain ) where @@ -18,17 +17,16 @@ import qualified Data.Map as M data MainState = MainState - { run :: !Bool - , driver :: !SomeDriver - , time :: !UTCTime - , players :: ![SomePlayer] - , textures :: !(M.Map Texture TextureObject) + { run :: !Bool + , driver :: !SomeDriver + , time :: !UTCTime + , players :: ![SomePlayer] + , textures :: !(M.Map Texture TextureObject) + , gameState :: !GameState } -newtype MainT m a = MainT (StateT MainState m a) - deriving (Monad, MonadState MainState, MonadIO, MonadTrans) +newtype Main a = Main (StateT MainState IO a) + deriving (Monad, MonadState MainState, MonadIO) -type Main = MainT Game - -runMain :: MainState -> Main a -> Game (a, MainState) -runMain st (MainT a) = runStateT a st +runMain :: MainState -> Main a -> IO (a, MainState) +runMain st (Main a) = runStateT a st |