Permalink
Browse files

Timestamps

  • Loading branch information...
1 parent 9691981 commit 43668796f07253de7aa8b6cdd4cd20e51923662f @MedeaMelana committed Sep 3, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 Engine.hs
View
@@ -150,6 +150,7 @@ compileEffect (MoveObject rObject@(rFromZone, i) rToZone) = do
case mObject of
Nothing -> return ()
Just object -> do
+ tick >>= puts (compileZoneRef rToZone .^ listEl i .^ timestamp)
compileZoneRef rFromZone ~: IdList.remove i
compileZoneRef rToZone ~: IdList.cons object
compileEffect (ShuffleLibrary rPlayer) = do
@@ -159,6 +160,12 @@ compileEffect (ShuffleLibrary rPlayer) = do
puts libraryLabel lib'
compileEffect _ = undefined
+tick :: Engine Timestamp
+tick = do
+ t <- gets time
+ time ~: succ
+ return t
+
lookupObject :: ObjectRef -> Engine (Maybe Object)
lookupObject (rz, i) = IdList.get i <$> gets (compileZoneRef rz)

0 comments on commit 4366879

Please sign in to comment.