Crossfire Server, Trunk  R22047
tod.h File Reference
#include "config.h"
+ Include dependency graph for tod.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _timeofday


#define DAYS_PER_WEEK   7
#define HOURS_PER_DAY   28
#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


typedef struct _timeofday timeofday_t


void get_tod (timeofday_t *tod)


static const float MOVE_PER_SECOND = MAX_TIME / 1000000.

Detailed Description

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

Definition in file tod.h.

Macro Definition Documentation



Definition at line 23 of file tod.h.

Referenced by get_tod().


#define DAYS_PER_WEEK   7

Definition at line 15 of file tod.h.

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



Definition at line 24 of file tod.h.


#define HOURS_PER_DAY   28

Definition at line 14 of file tod.h.

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



Definition at line 26 of file tod.h.

Referenced by get_tod().



Definition at line 25 of file tod.h.



Definition at line 27 of file tod.h.

Referenced by get_tod().



Definition at line 29 of file tod.h.


#define MONTHS_PER_YEAR   17

Definition at line 17 of file tod.h.

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


#define PERIODS_PER_DAY   6

Definition at line 19 of file tod.h.

Referenced by get_periodofday(), and initConstants().


#define PTICKS_PER_CLOCK   1500

Definition at line 11 of file tod.h.

Referenced by do_specials(), and get_tod().


#define SEASONS_PER_YEAR   5

Definition at line 18 of file tod.h.

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


#define WEEKS_PER_MONTH   5

Definition at line 16 of file tod.h.

Referenced by get_tod(), and initConstants().



Definition at line 22 of file tod.h.

Typedef Documentation

◆ timeofday_t

typedef struct _timeofday timeofday_t

Represents the ingame time.

Function Documentation

◆ get_tod()

void get_tod ( timeofday_t tod)

Computes the ingame time of the day.

[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:

Variable Documentation


const float MOVE_PER_SECOND = MAX_TIME / 1000000.

Speed of an object that gives it one move per second, real time.

Definition at line 50 of file tod.h.

Referenced by eat_special_food(), and potion_type_apply().