Copyright | (c) Anton Gushcha, 2015-2016 Oganyan Levon, 2016 |
---|---|
License | BSD3 |
Maintainer | ncrashed@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Utilities for handling time in engine arrows.
- type GameTime = Timed NominalDiffTime ()
- type GameSession = Session IO GameTime
- data NominalDiffTime :: *
- newGameSession :: GameSession
- stepGameSession :: MonadIO m => GameSession -> m (GameTime, GameSession)
Documentation
type GameTime = Timed NominalDiffTime () Source
Current value of simulation time.
type GameSession = Session IO GameTime Source
Session that stores time in diff format The only purpose is to store time while stepping simulation.
data NominalDiffTime :: *
This is a length of time, as measured by UTC. Conversion functions will treat it as seconds. It has a precision of 10^-12 s. It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), regardless of whether a leap-second intervened.
newGameSession :: GameSession Source
Creates new empty game session
stepGameSession :: MonadIO m => GameSession -> m (GameTime, GameSession) Source
Generates next value of game session and outputs current simulation time That simulation time should be feeded to game wire and next value of session should be used at next step of simulation.