jfreerails.world.common
Class GameCalendar
java.lang.Object
jfreerails.world.common.GameCalendar
- All Implemented Interfaces:
- java.io.Serializable, FreerailsSerializable
public final class GameCalendar
- extends java.lang.Object
- implements FreerailsSerializable
This class converts time measured in ticks since the game began into time
represented as Month, Year and hour:minute.
- Author:
- Luke
- See Also:
- Serialized Form
|
Constructor Summary |
GameCalendar(int ticksPerYear,
int startYear)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
decimalFormat
private static final java.text.DecimalFormat decimalFormat
ticksPerYear
private final int ticksPerYear
startYear
private final int startYear
GameCalendar
public GameCalendar(int ticksPerYear,
int startYear)
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
getStartOfYear
public GameTime getStartOfYear(GameTime t)
getYearAsString
public java.lang.String getYearAsString(int ticks)
getYear
public int getYear(int ticks)
getTicks
public int getTicks(int year)
getTimeOfDay
public java.lang.String getTimeOfDay(int i)
- Returns the time of day as a string, note that a year is made up of a
representative day, so 1st June is equilavent to 12 noon.
getYearAndMonth
public java.lang.String getYearAndMonth(int i)
getMonth
public int getMonth(int i)
- Returns the month, 0=Jan, 1=Feb, etc.
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals in class java.lang.Object
getTicksPerYear
public int getTicksPerYear()