Difference between revisions of "GetCurrentGameTime - Utility"

Jump to navigation Jump to search
This is already clear by virtue of it being a float (see Syntax section)
Tag: Reverted
(This is already clear by virtue of it being a float (see Syntax section))
Tag: Undo
 
Line 15: Line 15:
== Return Value ==
== Return Value ==
The current game time in terms of "game days passed".
The current game time in terms of "game days passed".
== Return Value ==
No it DOES NOT return QUITE what it is supposed to.
It returns a fractional value, NOT an EXACT Integer.
The comparison operators "<" and ">" will work but "==" WILL FAIL most of the time.
You must use a rounding function to cast the returned value to an exact integer i.e.
        ( (an integer value ) day == Math.Floor(Utility.GetCurrentGameTime())  )
or maybe
        ( (an integer value ) day == Math.Ceil(Utility.GetCurrentGameTime())  )


== Examples ==
== Examples ==

Navigation menu