Crossfire Server, Branches 1.12  R18729
tod.h
Go to the documentation of this file.
1 /*
2  * static char *rcsid_tod_h =
3  * "$Id: tod.h 9313 2008-06-13 12:05:26Z anmaster $";
4  */
5 
6 /*
7  CrossFire, A Multiplayer game for X-windows
8 
9  Copyright (C) 2003-2006 Mark Wedel & Crossfire Development Team
10  Copyright (C) 2000 Tim Rightnour
11  Copyright (C) 1992 Frank Tore Johansen
12 
13  This program is free software; you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 2 of the License, or
16  (at your option) any later version.
17 
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 
27  The authors can be reached via e-mail at crossfire-devel@real-time.com
28 */
29 
35 #ifndef TOD_H
36 #define TOD_H
37 
38 #define PTICKS_PER_CLOCK 1500
39 
40 /* game time */
41 #define HOURS_PER_DAY 28
42 #define DAYS_PER_WEEK 7
43 #define WEEKS_PER_MONTH 5
44 #define MONTHS_PER_YEAR 17
45 #define SEASONS_PER_YEAR 5
46 #define PERIODS_PER_DAY 6
47 
48 /* convenience */
49 #define WEEKS_PER_YEAR (WEEKS_PER_MONTH*MONTHS_PER_YEAR)
50 #define DAYS_PER_MONTH (DAYS_PER_WEEK*WEEKS_PER_MONTH)
51 #define DAYS_PER_YEAR (DAYS_PER_MONTH*MONTHS_PER_YEAR)
52 #define HOURS_PER_WEEK (HOURS_PER_DAY*DAYS_PER_WEEK)
53 #define HOURS_PER_MONTH (HOURS_PER_WEEK*WEEKS_PER_MONTH)
54 #define HOURS_PER_YEAR (HOURS_PER_MONTH*MONTHS_PER_YEAR)
55 
56 #define LUNAR_DAYS DAYS_PER_MONTH
57 
61 typedef struct _timeofday {
62  int year;
63  int month;
64  int day;
65  int dayofweek;
66  int hour;
67  int minute;
69  int season;
71 } timeofday_t;
72 
73 /* from common/time.c */
74 extern void get_tod(timeofday_t *tod);
75 
76 #endif /* TOD_H */
int minute
Definition: tod.h:67
struct _timeofday timeofday_t
int periodofday
Definition: tod.h:70
int year
Definition: tod.h:62
int month
Definition: tod.h:63
void get_tod(timeofday_t *tod)
Definition: time.c:268
int weekofmonth
Definition: tod.h:68
int day
Definition: tod.h:64
int dayofweek
Definition: tod.h:65
Definition: tod.h:61
int hour
Definition: tod.h:66
int season
Definition: tod.h:69