Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Version with open loop and internal StateT.

  • Loading branch information...
commit dcdd256ec80d31cd2ad956eaef2b10c577252280 1 parent a929bb4
@graninas authored
View
12 Amoeba/Application/Runtime/Engine.hs
@@ -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
View
2  Amoeba/Application/Runtime/Language.hs
@@ -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
BIN  Game/Amoeba
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.