1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 10:15:36 +01:00
Files
OpenRCT2/src/openrct2/Date.h
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00

47 lines
1.2 KiB
C++

/*****************************************************************************
* Copyright (c) 2014-2018 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "common.h"
namespace OpenRCT2
{
/**
* Represents the current day, month and year in OpenRCT2.
*/
class Date final
{
private:
uint16 _monthTicks = 0;
uint32 _monthsElapsed = 0;
public:
Date() = default;
Date(uint32 monthsElapsed, uint16 monthTicks);
static Date FromYMD(sint32 year, sint32 month = 0, sint32 day = 0);
void Update();
uint16 GetMonthTicks() const;
uint32 GetMonthsElapsed() const;
sint32 GetDay() const;
sint32 GetMonth() const;
sint32 GetYear() const;
bool IsDayStart() const;
bool IsWeekStart() const;
bool IsFortnightStart() const;
bool IsMonthStart() const;
static sint32 GetDaysInMonth(sint32 month);
};
}