jfreerails.world.common
Class GameTime

java.lang.Object
  extended by jfreerails.world.common.GameTime
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<GameTime>, FreerailsSerializable

public class GameTime
extends java.lang.Object
implements FreerailsSerializable, java.lang.Comparable<GameTime>

This class represents a specific instant in time during a game.

Author:
Luke
See Also:
Serialized Form

Field Summary
static GameTime BIG_BANG
          The first possible time.
static GameTime END_OF_THE_WORLD
          The last possible time.
private static long serialVersionUID
           
private  int ticks
           
 
Constructor Summary
GameTime(int l)
           
 
Method Summary
 int compareTo(GameTime t)
          Compares two GameTimes for ordering.
 boolean equals(java.lang.Object o)
           
 int getTicks()
           
 int hashCode()
           
 GameTime nextTick()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

BIG_BANG

public static final GameTime BIG_BANG
The first possible time.


END_OF_THE_WORLD

public static final GameTime END_OF_THE_WORLD
The last possible time.


ticks

private final int ticks
Constructor Detail

GameTime

public GameTime(int l)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

nextTick

public GameTime nextTick()

getTicks

public int getTicks()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(GameTime t)
Compares two GameTimes for ordering.

Specified by:
compareTo in interface java.lang.Comparable<GameTime>
Parameters:
t -
Returns:
0 if t is equal to this GameTime; a value less than 0 if this GameTime is before t; and a value greater than 0 if this GameTime is after t.