summaryrefslogtreecommitdiffstats
path: root/src/MainLoop.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/MainLoop.hs')
-rw-r--r--src/MainLoop.hs24
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