jfreerails.world.common
Class GameSpeed

java.lang.Object
  extended by jfreerails.world.common.GameSpeed
All Implemented Interfaces:
java.io.Serializable, FreerailsSerializable

public class GameSpeed
extends java.lang.Object
implements FreerailsSerializable

This class represents actual game speed. If the game speed speed is lesser then zero, game is paused. After unpausing, the speed should be -speed. I.e. pausing/unpausing is equal to multiply the speed by -1.

Author:
MystiqueAgent
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
private  int speed
           
 
Constructor Summary
GameSpeed(int speed)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getSpeed()
           
 int hashCode()
           
 boolean isPaused()
           
 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

speed

private final int speed
Constructor Detail

GameSpeed

public GameSpeed(int speed)
Method Detail

toString

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

getSpeed

public int getSpeed()

isPaused

public boolean isPaused()

equals

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

hashCode

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