Crossfire Server, Trunk  R20513
Data Structures | Macros | Typedefs | Functions
tod.h File Reference

Defines for the ingame clock, ticks management and weather system. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _timeofday
 Represents the ingame time. More...
 

Macros

#define DAYS_PER_MONTH   (DAYS_PER_WEEK*WEEKS_PER_MONTH)
 
#define DAYS_PER_WEEK   7
 
#define DAYS_PER_YEAR   (DAYS_PER_MONTH*MONTHS_PER_YEAR)
 
#define HOURS_PER_DAY   28
 
#define HOURS_PER_MONTH   (HOURS_PER_WEEK*WEEKS_PER_MONTH)
 
#define HOURS_PER_WEEK   (HOURS_PER_DAY*DAYS_PER_WEEK)
 
#define HOURS_PER_YEAR   (HOURS_PER_MONTH*MONTHS_PER_YEAR)
 
#define LUNAR_DAYS   DAYS_PER_MONTH
 
#define MONTHS_PER_YEAR   17
 
#define PERIODS_PER_DAY   6
 
#define PTICKS_PER_CLOCK   1500
 
#define SEASONS_PER_YEAR   5
 
#define WEEKS_PER_MONTH   5
 
#define WEEKS_PER_YEAR   (WEEKS_PER_MONTH*MONTHS_PER_YEAR)
 

Typedefs

typedef struct _timeofday timeofday_t
 Represents the ingame time. More...
 

Functions

void get_tod (timeofday_t *tod)
 Computes the ingame time of the day. More...
 

Detailed Description

Defines for the ingame clock, ticks management and weather system.

Definition in file tod.h.

Macro Definition Documentation

#define DAYS_PER_MONTH   (DAYS_PER_WEEK*WEEKS_PER_MONTH)

Definition at line 21 of file tod.h.

Referenced by get_tod().

#define DAYS_PER_WEEK   7

Definition at line 13 of file tod.h.

Referenced by get_tod(), get_weekday(), initConstants(), and START_TEST().

#define DAYS_PER_YEAR   (DAYS_PER_MONTH*MONTHS_PER_YEAR)

Definition at line 22 of file tod.h.

#define HOURS_PER_DAY   28

Definition at line 12 of file tod.h.

Referenced by get_tod(), initConstants(), and set_darkness_map().

#define HOURS_PER_MONTH   (HOURS_PER_WEEK*WEEKS_PER_MONTH)

Definition at line 24 of file tod.h.

Referenced by get_tod().

#define HOURS_PER_WEEK   (HOURS_PER_DAY*DAYS_PER_WEEK)

Definition at line 23 of file tod.h.

#define HOURS_PER_YEAR   (HOURS_PER_MONTH*MONTHS_PER_YEAR)

Definition at line 25 of file tod.h.

Referenced by get_tod().

#define LUNAR_DAYS   DAYS_PER_MONTH

Definition at line 27 of file tod.h.

#define MONTHS_PER_YEAR   17

Definition at line 15 of file tod.h.

Referenced by get_month_name(), get_tod(), initConstants(), and START_TEST().

#define PERIODS_PER_DAY   6

Definition at line 17 of file tod.h.

Referenced by get_periodofday(), and initConstants().

#define PTICKS_PER_CLOCK   1500

Definition at line 9 of file tod.h.

Referenced by do_specials(), and get_tod().

#define SEASONS_PER_YEAR   5

Definition at line 16 of file tod.h.

Referenced by get_season_name(), initConstants(), and START_TEST().

#define WEEKS_PER_MONTH   5

Definition at line 14 of file tod.h.

Referenced by get_tod(), and initConstants().

#define WEEKS_PER_YEAR   (WEEKS_PER_MONTH*MONTHS_PER_YEAR)

Definition at line 20 of file tod.h.

Typedef Documentation

typedef struct _timeofday timeofday_t

Represents the ingame time.

Function Documentation

void get_tod ( timeofday_t tod)

Computes the ingame time of the day.

Parameters
[out]todwhere to store information. Must not be NULL.

Definition at line 215 of file time.c.

References _timeofday::day, _timeofday::dayofweek, DAYS_PER_MONTH, DAYS_PER_WEEK, _timeofday::hour, HOURS_PER_DAY, HOURS_PER_MONTH, HOURS_PER_YEAR, _timeofday::minute, _timeofday::month, MONTHS_PER_YEAR, _timeofday::periodofday, pticks, PTICKS_PER_CLOCK, _timeofday::season, todtick, _timeofday::weekofmonth, WEEKS_PER_MONTH, and _timeofday::year.

Referenced by cfapi_get_time(), clock_type_apply(), print_tod(), set_darkness_map(), and tick_the_clock().

Here is the caller graph for this function: