Crossfire Server, Branches 1.12  R18729
tod.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _timeofday
 

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
 

Functions

void get_tod (timeofday_t *tod)
 

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 50 of file tod.h.

Referenced by get_tod().

#define DAYS_PER_WEEK   7

Definition at line 42 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 51 of file tod.h.

#define HOURS_PER_DAY   28

Definition at line 41 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 53 of file tod.h.

Referenced by get_tod().

#define HOURS_PER_WEEK   (HOURS_PER_DAY*DAYS_PER_WEEK)

Definition at line 52 of file tod.h.

#define HOURS_PER_YEAR   (HOURS_PER_MONTH*MONTHS_PER_YEAR)

Definition at line 54 of file tod.h.

Referenced by get_tod().

#define LUNAR_DAYS   DAYS_PER_MONTH

Definition at line 56 of file tod.h.

#define MONTHS_PER_YEAR   17

Definition at line 44 of file tod.h.

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

#define PERIODS_PER_DAY   6

Definition at line 46 of file tod.h.

Referenced by get_periodofday(), and initConstants().

#define PTICKS_PER_CLOCK   1500

Definition at line 38 of file tod.h.

Referenced by do_specials(), and get_tod().

#define SEASONS_PER_YEAR   5

Definition at line 45 of file tod.h.

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

#define WEEKS_PER_MONTH   5

Definition at line 43 of file tod.h.

Referenced by get_tod(), and initConstants().

#define WEEKS_PER_YEAR   (WEEKS_PER_MONTH*MONTHS_PER_YEAR)

Definition at line 49 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 268 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: