37 double gamedate::Ticks = 0.0;
49 while (Ticks >= tenth_minute)
51 Ticks -= tenth_minute;
88 return Time / day_in_minutes;
100 return (Time / 10) % 60;
106 u_int32 t_minutes = 0, number = 0;
112 if (isdigit (
time[i]))
115 number = 10 * number + atoi (num);
118 else if (isalpha (
time[i]))
137 t_minutes += number * 600;
143 t_minutes += number * 10;
155 fprintf (stderr,
"*** gamedate::parse_time: Unknown time specifier '%c'\n",
time[i]);
static bool get_state(igzstream &in)
Load the state of the gamedate class from disk.
static void raise_event(const event *ev)
Check if an event corresponding to ev exists, and execute it.
Class to write data from a Gzip compressed file.
static u_int16 weekday()
Get the current weekday.
Declares the event_handler class.
Class to read data from a Gzip compressed file.
#define u_int16
16 bits long unsigned integer
static double minute()
Return the in-game time that passed since the last call to this method.
static u_int16 hour()
Return the hour of the current day.
Declares the gametime class.
#define DAYS_PER_WEEK
The number of days that make one gameworld week.
#define u_int32
32 bits long unsigned integer
static u_int16 day()
Returns the current day in the gameworld.
static u_int32 time()
Get the current gametime.
The time event executes the attached script or callback at a certain point in game-time.
static u_int16 minute()
Return the minute of the current hour.
static u_int8 frames_to_skip()
Returns the number of updates to perform before drawing the next frame.
Declares the gamedate class.
#define HOURS_PER_DAY
The number of hours that make one gameworld day.
static u_int32 parse_time(const std::string &time)
convert the time string to gametime minutes.
Declares the time_event class.
static void put_state(ogzstream &out)
Save the state of the gamedate class to disk.
static void update()
Update the game date.