java.lang.Cloneable, CMCommon, CMObject, java.lang.Comparable<CMObject>, TickableDefaultTimeClockpublic interface TimeClock extends Tickable, CMCommon
Area.setTimeObj(TimeClock),
Area.getTimeObj()| Modifier and Type | Interface | Description |
|---|---|---|
static class |
TimeClock.MoonPhase |
The phases of the moon
|
static class |
TimeClock.Season |
Enumeration for the season of the year
|
static class |
TimeClock.TidePhase |
The phases of the tides
|
static class |
TimeClock.TimeOfDay |
Time of Day enumeration
|
static class |
TimeClock.TimePeriod |
Different time periods.
|
idConverterSTATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET| Modifier and Type | Method | Description |
|---|---|---|
void |
bump(TimeClock.TimePeriod P,
int num) |
Increase this clocks time by the given number of
time periods.
|
void |
bumpDays(int num) |
Increase this clocks time by the given number of days.
|
void |
bumpHours(int num) |
Increase this clocks time by the given number of hours.
|
void |
bumpMonths(int num) |
Increase this clocks time by the given number of months.
|
void |
bumpWeeks(int num) |
Increase this clocks time by the given number of weeks.
|
void |
bumpYears(int num) |
Increase this clocks time by the given number of years.
|
TimeClock |
deriveClock(long millis) |
Using the current time and date as a yardstick, and assuming constant
running and perfect timing, this method will derive a mud date and time
from the given real life date/time in milliseconds.
|
java.lang.String |
deriveEllapsedTimeString(long millis) |
Using the given number of milliseconds, this method will return a string
describing the number of mud days, hours, etc that is represented by
that amount of real time, assuming constant running and perfect timing.
|
long |
deriveMillisAfter(TimeClock C) |
This method will discover the difference in mud hours between this time clock
and the given EARLIER clock, assuming they use the same scale of measurement.
|
long |
deriveMudHoursAfter(TimeClock C) |
This method will discover the difference in mud hours between this time clock
and the given EARLIER clock, assuming they use the same scale of measurement.
|
TimeClock |
fromTimePeriodCodeString(java.lang.String period) |
Copies this clock and sets it accord to
the coded date/time.
|
int[] |
getDawnToDusk() |
Gets the dawn to dusk values, indexed by the TOD constants.
|
int |
getDayOfMonth() |
Gets the current day of month.
|
int |
getDayOfYear() |
Gets the current days of the year.
|
int |
getDaysInMonth() |
Gets the days in a month.
|
int |
getDaysInWeek() |
Gets the number of days in each week
|
int |
getDaysInYear() |
Gets the current days of the year.
|
int |
getHourOfDay() |
Gets the current time of day (the hour).
|
int |
getHoursInDay() |
Gets the hours in a day.
|
int |
getHoursPer(TimeClock.TimePeriod period) |
Given a time period, returns the number of mud hours
contained in each, based on this clock.
|
int |
getMonth() |
Gets the current month.
|
java.lang.String[] |
getMonthNames() |
Gets the month names, in order, indexed by 0.
|
int |
getMonthsInSeason() |
Returns the number of months in a season.
|
int |
getMonthsInYear() |
Gets the months in a year.
|
TimeClock.MoonPhase |
getMoonPhase(Room room) |
Gets the moon phase an an enumeration.
|
long |
getPeriodMillis(TimeClock.TimePeriod P) |
Given a standard time period, returns this local clocks
elapsed millis for each period.
|
TimeClock.Season |
getSeasonCode() |
Gets the season code.
|
java.lang.String |
getShortestTimeDescription() |
Gets the shortest time description, showing only the date and
time in brief numeric format.
|
java.lang.String |
getShortTimeDescription() |
Gets a shorter time description, showing the date and time in
full sentence format, but skipping lunar orientation.
|
TimeClock.TidePhase |
getTidePhase(Room room) |
Gets the phase of the tides as an enumeration.
|
TimeClock.TimeOfDay |
getTODCode() |
Gets the TOD code, which is the sun-orientation (morning, evening, etc)
|
java.lang.String[] |
getWeekNames() |
Gets the week names, which is the names of the days of each week,
a string array indexed by the day of the week - 1.
|
int |
getWeekOfMonth() |
Gets the current week of the month.
|
int |
getWeekOfYear() |
Gets the current week of the year.
|
int |
getYear() |
Gets the current year.
|
java.lang.String[] |
getYearNames() |
Gets the names of the year, an arbitrary sized list that is rotated
through from year to year.
|
void |
handleTimeChange() |
Causes the world to visibly react to a change in time
|
void |
initializeINIClock(CMProps page) |
Initialize ini clock by reading calendar values from the given
properties page.
|
boolean |
isAfter(TimeClock C) |
Returns whether this time clock represents an
earlier later than the given one, timezones
notwithstanding.
|
boolean |
isBefore(TimeClock C) |
Returns whether this time clock represents an
earlier hour than the given one, timezones
notwithstanding.
|
boolean |
isEqual(TimeClock C) |
Returns whether this time clock represents the
exact same hour as the given one, timezones
notwithstanding.
|
void |
save() |
Saves the current time/date information where ever its supposed
to be saved.
|
void |
setDawnToDusk(int dawn,
int day,
int dusk,
int night) |
Sets the dawn to dusk values as absolute hours when that particular
time of day begins.
|
void |
setDayOfMonth(int d) |
Sets the current day of month.
|
void |
setDaysInMonth(int d) |
Sets the days in a month.
|
void |
setDaysInWeek(java.lang.String[] days) |
Sets the number of days in each week by naming each of them in a string array
|
void |
setFromHoursSinceEpoc(long num) |
Sets this clock to the given number
of hours since epoc.
|
boolean |
setHourOfDay(int t) |
Sets the time of day (the hour).
|
void |
setHoursInDay(int h) |
Sets the hours in a day.
|
void |
setLoadName(java.lang.String name) |
Sets the name of this time object for the purposes of database loading
and saving.
|
void |
setMonth(int m) |
Sets the current month.
|
void |
setMonthsInYear(java.lang.String[] months) |
Sets the months in year as a string array of names, arranged in order.
|
void |
setYear(int y) |
Sets the current year.
|
void |
setYearNames(java.lang.String[] years) |
Sets the year names, which is an arbitrary sized list that is rotated
through from year to year.
|
void |
tickTock(int howManyHours) |
Alters the time/day by the given number of hours (forward
or backward)
|
java.lang.String |
timeDescription(MOB mob,
Room room) |
Returns a complete description of the date, time, and lunar
orientation, and day of the week in a full sentence word
format.
|
long |
toHoursSinceEpoc() |
Returns the total hours since epoc
|
java.lang.String |
toTimePeriodCodeString() |
Returns this clocks date/time, plus a brief
definition of the scale of the various time periods.
|
long |
toTimestamp(TimeClock now) |
Converts this TimeClock to an approximate real-life
millis since epoc.
|
copyOf, ID, initializeClass, newInstancegetTickStatus, name, tickjava.lang.String timeDescription(MOB mob, Room room)
mob - the mob who wants to know the timeroom - the room the room where the mob is wanting the timegetShortTimeDescription(),
getShortestTimeDescription()java.lang.String getShortTimeDescription()
timeDescription(MOB, Room),
getShortestTimeDescription()java.lang.String getShortestTimeDescription()
timeDescription(MOB, Room),
getShortTimeDescription()int getYear()
setYear(int)void setYear(int y)
y - the new yeargetYear()int getMonth()
setMonth(int)void setMonth(int m)
m - the new monthgetMonth()int getDayOfMonth()
setDayOfMonth(int)void setDayOfMonth(int d)
d - the new day of monthgetDayOfMonth()int getHourOfDay()
setHourOfDay(int)boolean setHourOfDay(int t)
t - the time of day (the hour)getHourOfDay()TimeClock.TimeOfDay getTODCode()
setHourOfDay(int),
setDawnToDusk(int, int, int, int),
TimeClock.TimeOfDayTimeClock.MoonPhase getMoonPhase(Room room)
room - the room to check the moon phase forTimeClock.MoonPhaseTimeClock.TidePhase getTidePhase(Room room)
room - the room to check the tide phase forTimeClock.TidePhaseTimeClock.Season getSeasonCode()
TimeClock.Seasonint getMonthsInSeason()
void tickTock(int howManyHours)
howManyHours - the how many hours to alter the time byvoid save()
setLoadName(String)void setLoadName(java.lang.String name)
name - the new load namesave()int getHoursInDay()
setHoursInDay(int)void setHoursInDay(int h)
h - the new hours in a daygetHoursInDay()int getDaysInMonth()
setDaysInMonth(int)void setDaysInMonth(int d)
d - the new days in a monthgetDaysInMonth()int getMonthsInYear()
setMonthsInYear(String[]),
getMonthNames()java.lang.String[] getMonthNames()
setMonthsInYear(String[]),
getMonthNames()void setMonthsInYear(java.lang.String[] months)
months - the new month names in a yeargetMonthNames(),
getMonthsInYear()int[] getDawnToDusk()
getTODCode(),
setDawnToDusk(int, int, int, int),
TimeClock.TimeOfDayvoid setDawnToDusk(int dawn,
int day,
int dusk,
int night)
dawn - the dawn hourday - the day hourdusk - the dusk hournight - the night hourgetDawnToDusk(),
getTODCode(),
TimeClock.TimeOfDayjava.lang.String[] getWeekNames()
setDaysInWeek(String[]),
getDaysInWeek()int getDaysInWeek()
setDaysInWeek(String[]),
getWeekNames()int getWeekOfMonth()
getDaysInWeek()int getWeekOfYear()
getDaysInWeek()int getDayOfYear()
int getDaysInYear()
void setDaysInWeek(java.lang.String[] days)
days - the new days in each week string arraygetDaysInWeek(),
getWeekNames()java.lang.String[] getYearNames()
setYearNames(String[])void setYearNames(java.lang.String[] years)
years - the new years namesgetYearNames()TimeClock deriveClock(long millis)
millis - the milliseconds since 1970deriveMillisAfter(TimeClock),
deriveEllapsedTimeString(long)long deriveMillisAfter(TimeClock C)
C - the earlier time clock objectderiveClock(long),
deriveEllapsedTimeString(long)long deriveMudHoursAfter(TimeClock C)
C - the earlier time clock objectderiveClock(long),
deriveEllapsedTimeString(long)long getPeriodMillis(TimeClock.TimePeriod P)
P - the TimePeriod to get a duration forboolean isEqual(TimeClock C)
C - the clock to compare toisBefore(TimeClock),
isEqual(TimeClock),
isAfter(TimeClock)boolean isBefore(TimeClock C)
C - the clock to compare toboolean isAfter(TimeClock C)
C - the clock to compare tovoid bumpHours(int num)
num - the number to bumptickTock(int),
bumpDays(int),
bumpWeeks(int),
bumpMonths(int),
bumpYears(int),
bump(TimePeriod, int)void bumpDays(int num)
num - the number to bumptickTock(int),
bumpHours(int),
bumpWeeks(int),
bumpMonths(int),
bumpYears(int),
bump(TimePeriod, int)void bumpWeeks(int num)
num - the number to bumptickTock(int),
bumpHours(int),
bumpDays(int),
bumpMonths(int),
bumpYears(int),
bump(TimePeriod, int)void bumpMonths(int num)
num - the number to bumptickTock(int),
bumpHours(int),
bumpDays(int),
bumpWeeks(int),
bumpYears(int),
bump(TimePeriod, int)void bumpYears(int num)
num - the number to bumptickTock(int),
bumpHours(int),
bumpDays(int),
bumpWeeks(int),
bumpMonths(int),
bump(TimePeriod, int)void bump(TimeClock.TimePeriod P, int num)
P - the time periodnum - the number of periods to bump bytickTock(int),
bumpHours(int),
bumpDays(int),
bumpWeeks(int),
bumpMonths(int),
bumpYears(int)long toHoursSinceEpoc()
setFromHoursSinceEpoc(long)void setFromHoursSinceEpoc(long num)
num - the new time, in hours since epoc.tickTock(int),
toHoursSinceEpoc()java.lang.String deriveEllapsedTimeString(long millis)
millis - the milliseconds of elapsed time representedderiveMillisAfter(TimeClock),
deriveClock(long)void initializeINIClock(CMProps page)
page - the properties pagevoid handleTimeChange()
long toTimestamp(TimeClock now)
now - TODOjava.lang.String toTimePeriodCodeString()
TimeClock fromTimePeriodCodeString(java.lang.String period)
period - the coded timeint getHoursPer(TimeClock.TimePeriod period)
period - the period you are curious about