Permalink
Browse files

- Version with open loop and internal StateT.

  • Loading branch information...
graninas committed Jan 31, 2014
1 parent a929bb4 commit dcdd256ec80d31cd2ad956eaef2b10c577252280
Showing with 9 additions and 5 deletions.
  1. +8 −4 Amoeba/Application/Runtime/Engine.hs
  2. +1 −1 Amoeba/Application/Runtime/Language.hs
  3. BIN Game/Amoeba
@@ -13,18 +13,22 @@ startMainLoop :: Configuration -> View -> WWire Int Int -> IO Int
startMainLoop cfg view wire = do
let rt = runtime cfg view
(s, session') <- stepSession clockSession_
- (output, w') <- stepWire wire s (Right 10)
+ let state = gameLoop wire s (Right 10)
+ let newState = execStateT state rt
+ return 10
+
+gameLoop wire s input = do
+ (output, w') <- stepWire wire s input
case output of
Left ex -> return 10
Right x -> return 20
-
{-
startMainLoop cfg view wire = do
let rt = runtime cfg view
- gameLoop wire (Right ())
- --execStateT w rt
+ let w = gameLoop wire (Right ())
+ execStateT w rt
gameLoop w input = do
@@ -14,7 +14,7 @@ data Runtime = Runtime { rtConfiguration :: Configuration
type WStateIO = StateT Runtime IO
-type WWire a b = Wire (Timed NominalDiffTime ()) () IO a b
+type WWire a b = Wire (Timed NominalDiffTime ()) () WStateIO a b
runtime = Runtime
View
Binary file not shown.

0 comments on commit dcdd256

Please sign in to comment.