Crossfire Server, Trunk  R20513
tod.h
Go to the documentation of this file.
1 
6 #ifndef TOD_H
7 #define TOD_H
8 
9 #define PTICKS_PER_CLOCK 1500
10 
11 /* game time */
12 #define HOURS_PER_DAY 28
13 #define DAYS_PER_WEEK 7
14 #define WEEKS_PER_MONTH 5
15 #define MONTHS_PER_YEAR 17
16 #define SEASONS_PER_YEAR 5
17 #define PERIODS_PER_DAY 6
18 
19 /* convenience */
20 #define WEEKS_PER_YEAR (WEEKS_PER_MONTH*MONTHS_PER_YEAR)
21 #define DAYS_PER_MONTH (DAYS_PER_WEEK*WEEKS_PER_MONTH)
22 #define DAYS_PER_YEAR (DAYS_PER_MONTH*MONTHS_PER_YEAR)
23 #define HOURS_PER_WEEK (HOURS_PER_DAY*DAYS_PER_WEEK)
24 #define HOURS_PER_MONTH (HOURS_PER_WEEK*WEEKS_PER_MONTH)
25 #define HOURS_PER_YEAR (HOURS_PER_MONTH*MONTHS_PER_YEAR)
26 
27 #define LUNAR_DAYS DAYS_PER_MONTH
28 
32 typedef struct _timeofday {
33  int year;
34  int month;
35  int day;
36  int dayofweek;
37  int hour;
38  int minute;
40  int season;
42 } timeofday_t;
43 
44 /* from common/time.c */
45 extern void get_tod(timeofday_t *tod);
46 
47 #endif /* TOD_H */
int minute
Definition: tod.h:38
struct _timeofday timeofday_t
Represents the ingame time.
int periodofday
Definition: tod.h:41
int year
Definition: tod.h:33
int month
Definition: tod.h:34
void get_tod(timeofday_t *tod)
Computes the ingame time of the day.
Definition: time.c:215
int weekofmonth
Definition: tod.h:39
int day
Definition: tod.h:35
int dayofweek
Definition: tod.h:36
Represents the ingame time.
Definition: tod.h:32
int hour
Definition: tod.h:37
int season
Definition: tod.h:40