Atrinik Server 2.5
include/tod.h
Go to the documentation of this file.
00001 /************************************************************************
00002 *            Atrinik, a Multiplayer Online Role Playing Game            *
00003 *                                                                       *
00004 *    Copyright (C) 2009-2011 Alex Tokar and Atrinik Development Team    *
00005 *                                                                       *
00006 * Fork from Daimonin (Massive Multiplayer Online Role Playing Game)     *
00007 * and Crossfire (Multiplayer game for X-windows).                       *
00008 *                                                                       *
00009 * This program is free software; you can redistribute it and/or modify  *
00010 * it under the terms of the GNU General Public License as published by  *
00011 * the Free Software Foundation; either version 2 of the License, or     *
00012 * (at your option) any later version.                                   *
00013 *                                                                       *
00014 * This program is distributed in the hope that it will be useful,       *
00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00017 * GNU General Public License for more details.                          *
00018 *                                                                       *
00019 * You should have received a copy of the GNU General Public License     *
00020 * along with this program; if not, write to the Free Software           *
00021 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             *
00022 *                                                                       *
00023 * The author can be reached at admin@atrinik.org                        *
00024 ************************************************************************/
00025 
00030 #ifndef TOD_H
00031 #define TOD_H
00032 
00034 #define PTICKS_PER_CLOCK    1500
00035 
00037 #define HOURS_PER_DAY       24
00038 
00039 #define DAYS_PER_WEEK       7
00040 
00041 #define WEEKS_PER_MONTH     4
00042 
00043 #define MONTHS_PER_YEAR     12
00044 
00045 #define SEASONS_PER_YEAR    5
00046 
00047 #define PERIODS_PER_DAY     6
00048 
00050 #define WEEKS_PER_YEAR      (WEEKS_PER_MONTH * MONTHS_PER_YEAR)
00051 
00052 #define DAYS_PER_MONTH      (DAYS_PER_WEEK * WEEKS_PER_MONTH)
00053 
00054 #define DAYS_PER_YEAR       (DAYS_PER_MONTH * MONTHS_PER_YEAR)
00055 
00056 #define HOURS_PER_WEEK      (HOURS_PER_DAY * DAYS_PER_WEEK)
00057 
00058 #define HOURS_PER_MONTH     (HOURS_PER_WEEK * WEEKS_PER_MONTH)
00059 
00060 #define HOURS_PER_YEAR      (HOURS_PER_MONTH * MONTHS_PER_YEAR)
00061 
00062 extern const char *season_name[SEASONS_PER_YEAR + 1];
00063 extern const char *weekdays[DAYS_PER_WEEK];
00064 extern const char *month_name[MONTHS_PER_YEAR];
00065 extern const char *periodsofday[PERIODS_PER_DAY];
00066 
00068 typedef struct _timeofday
00069 {
00071     int year;
00072 
00074     int month;
00075 
00077     int day;
00078 
00080     int dayofweek;
00081 
00083     int hour;
00084 
00086     int minute;
00087 
00089     int weekofmonth;
00090 
00092     int season;
00093 
00095     int periodofday;
00096 } timeofday_t;
00097 
00098 #endif