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