Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Timestamps

  • Loading branch information...
commit 43668796f07253de7aa8b6cdd4cd20e51923662f 1 parent 9691981
@MedeaMelana authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 Engine.hs
View
7 Engine.hs
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.