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