Crossfire Server  1.75.0
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 struct timeofday_t {
39  int year;
40  int month;
41  int day;
42  int dayofweek;
43  int hour;
44  int minute;
46  int season;
48 };
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 */
int day
Definition: tod.h:41
int month
Definition: tod.h:40
This file contains various #defines that select various options.
Represents the ingame time.
Definition: tod.h:38
static const float MOVE_PER_SECOND
Speed of an object that gives it one move per second, real time.
Definition: tod.h:54
int minute
Definition: tod.h:44
int periodofday
Definition: tod.h:47
unsigned long todtick
Game world time, in in-game hours.
Definition: time.cpp:38
int dayofweek
Definition: tod.h:42
void get_tod(timeofday_t *tod)
Computes the ingame time of the day.
Definition: time.cpp:219
#define MAX_TIME
If you feel the game is too fast or too slow, change MAX_TIME.
Definition: config.h:254
int hour
Definition: tod.h:43
int weekofmonth
Definition: tod.h:45
int year
Definition: tod.h:39
int season
Definition: tod.h:46