Singleton class that manages the current date in the game.
Definition gamedate.h:118
GameDate(const GameDate &)=delete
GameDate & operator=(const GameDate &)=delete
void nextMonth()
Advances the current date by one month.
Definition gamedate.h:146
static GameDate & instance()
Gets the singleton instance.
Definition gamedate.h:124
GameDateValue getCurrent() const
Gets the current date.
Definition gamedate.h:134
void nextDay()
Advances the current date by one day.
Definition gamedate.h:142
GameDateValue current
Definition gamedate.h:153
GameDate()
Definition gamedate.h:149
void setCurrent(GameDateValue d)
Sets the current date.
Definition gamedate.h:139
void nextWeek()
Advances the current date by one week.
Definition gamedate.h:144
float d
Definition match_stadium_3d.cpp:369
Represents a specific date in the game world.
Definition gamedate.h:20
uint16_t year
Definition gamedate.h:21
GameDateValue operator+(size_t days) const
Adds a specified number of days to the date.
Definition gamedate.cpp:77
void nextDay()
Advances the date by one day.
Definition gamedate.cpp:45
GameDateValue(uint16_t y=2025, uint8_t m=7, uint8_t d=1)
Constructs a GameDateValue.
Definition gamedate.h:35
GameDateValue operator[](size_t i) const
Accesses the date part by index (0=year, 1=month, 2=day).
Definition gamedate.cpp:70
bool operator==(const GameDateValue &other) const
Checks if this date is equal to another.
Definition gamedate.cpp:111
static uint8_t daysInMonth(uint8_t m, uint16_t y)
Definition gamedate.cpp:38
bool operator<(const GameDateValue &other) const
Checks if this date is earlier than another.
Definition gamedate.cpp:104
std::string toString() const
Converts the date to a string representation.
Definition gamedate.cpp:116
uint8_t day
Definition gamedate.h:23
void nextWeek()
Advances the date by one week.
Definition gamedate.cpp:55
SeasonPhase checkPhase() const
Checks the current phase of the season.
Definition gamedate.cpp:141
void nextMonth()
Advances the date by one month.
Definition gamedate.cpp:60
static bool isLeapYear(uint16_t y)
Definition gamedate.cpp:33
static GameDateValue fromString(const std::string &str)
Parses a date from a string.
Definition gamedate.cpp:121
GameDateValue operator-(size_t days) const
Subtracts a specified number of days from the date.
Definition gamedate.cpp:82
uint8_t month
Definition gamedate.h:22
SeasonPhase
Represents the different phases of a season.
Definition types.h:28