Package net.royalur.rules
Class TimeProvider.Untimed
java.lang.Object
net.royalur.rules.TimeProvider.Untimed
- All Implemented Interfaces:
TimeProvider
- Enclosing interface:
- TimeProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.royalur.rules.TimeProvider
TimeProvider.Timed, TimeProvider.Untimed
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Gets the start time of the game in milliseconds since the epoch.long
Gets the number of milliseconds elapsed since the start of the game.boolean
isTimed()
Checks whether this time provider produces values other than zero.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.royalur.rules.TimeProvider
getGameStartTime
-
Constructor Details
-
Untimed
public Untimed()
-
-
Method Details
-
isTimed
public boolean isTimed()Description copied from interface:TimeProvider
Checks whether this time provider produces values other than zero.- Specified by:
isTimed
in interfaceTimeProvider
- Returns:
- Whether this time provider produces values other than zero.
-
getGameStartEpochMs
public long getGameStartEpochMs()Description copied from interface:TimeProvider
Gets the start time of the game in milliseconds since the epoch. If this provider is untimed,0
will be returned instead.- Specified by:
getGameStartEpochMs
in interfaceTimeProvider
- Returns:
- The start time of the game in milliseconds since the epoch.
-
getTimeSinceGameStartMs
public long getTimeSinceGameStartMs()Description copied from interface:TimeProvider
Gets the number of milliseconds elapsed since the start of the game.- Specified by:
getTimeSinceGameStartMs
in interfaceTimeProvider
- Returns:
- The number of milliseconds elapsed since the start of the game.
-