CommonLibSSE NG
Loading...
Searching...
No Matches
Calendar.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/B/BSTSingleton.h"
4
5namespace RE
6{
7 class TESGlobal;
8
9 class Calendar : public BSTSingletonSDM<Calendar>
10 {
11 public:
12 static constexpr std::uint8_t DAYS_IN_MONTH[] = {
13 31, // Morning Star
14 28, // Sun's Dawn
15 31, // First Seed
16 30, // Rain's Hand
17 31, // Second Seed
18 30, // Midyear
19 31, // Sun's Height
20 31, // Last Seed
21 30, // Hearthfire
22 31, // Frostfall
23 30, // Sun's Dusk
24 31 // Evening Star
25 };
26
27 struct Days
28 {
29 enum Day
30 {
38 kTotal
39 };
40 };
41 using Day = Days::Day;
42
43 struct Months
44 {
45 enum Month
46 {
59 kTotal
60 };
61 };
63
65
66 [[nodiscard]] float GetCurrentGameTime() const;
67 [[nodiscard]] float GetDay() const;
68 [[nodiscard]] std::string GetDayName() const;
69 [[nodiscard]] std::uint32_t GetDayOfWeek() const;
70 [[nodiscard]] float GetDaysPassed() const;
71 void GetTimeDateString(char* a_dest, std::uint32_t a_max, bool a_showYear) const;
72 [[nodiscard]] float GetHour() const;
73 [[nodiscard]] float GetHoursPassed() const;
74 [[nodiscard]] float GetHoursPerDay() const;
75 [[nodiscard]] std::uint32_t GetMonth() const;
76 [[nodiscard]] std::string GetMonthName() const;
77 [[nodiscard]] std::tm GetTime() const;
78 [[nodiscard]] float GetTimescale() const;
79 [[nodiscard]] std::uint32_t GetYear() const;
80
81 // members
82 std::uint8_t pad01; // 01
83 std::uint16_t pad02; // 02
84 std::uint32_t pad04; // 04
91 std::uint32_t midnightsPassed; // 38
92 float rawDaysPassed; // 3C
93 };
94 static_assert(sizeof(Calendar) == 0x40);
95}
Definition Calendar.h:10
std::uint32_t GetYear() const
std::string GetDayName() const
std::uint32_t GetMonth() const
float GetHour() const
TESGlobal * gameYear
Definition Calendar.h:85
TESGlobal * gameDay
Definition Calendar.h:87
void GetTimeDateString(char *a_dest, std::uint32_t a_max, bool a_showYear) const
float GetHoursPassed() const
float rawDaysPassed
Definition Calendar.h:92
static constexpr std::uint8_t DAYS_IN_MONTH[]
Definition Calendar.h:12
TESGlobal * timeScale
Definition Calendar.h:90
float GetDaysPassed() const
std::tm GetTime() const
TESGlobal * gameDaysPassed
Definition Calendar.h:89
float GetDay() const
TESGlobal * gameMonth
Definition Calendar.h:86
std::uint32_t GetDayOfWeek() const
float GetCurrentGameTime() const
float GetTimescale() const
float GetHoursPerDay() const
std::uint32_t pad04
Definition Calendar.h:84
std::uint16_t pad02
Definition Calendar.h:83
std::uint32_t midnightsPassed
Definition Calendar.h:91
std::uint8_t pad01
Definition Calendar.h:82
TESGlobal * gameHour
Definition Calendar.h:88
static Calendar * GetSingleton()
std::string GetMonthName() const
Definition TESGlobal.h:10
Definition AbsorbEffect.h:6
Definition BSTSingleton.h:50
Definition Calendar.h:28
Day
Definition Calendar.h:30
@ kMiddas
Definition Calendar.h:34
@ kLoredas
Definition Calendar.h:37
@ kMorndas
Definition Calendar.h:32
@ kSundas
Definition Calendar.h:31
@ kFredas
Definition Calendar.h:36
@ kTurdas
Definition Calendar.h:35
@ kTirdas
Definition Calendar.h:33
@ kTotal
Definition Calendar.h:38
Definition Calendar.h:44
Month
Definition Calendar.h:46
@ kTotal
Definition Calendar.h:59
@ kMidyear
Definition Calendar.h:52
@ kMorningStar
Definition Calendar.h:47
@ kRainsHand
Definition Calendar.h:50
@ kLastSeed
Definition Calendar.h:54
@ kSecondSeed
Definition Calendar.h:51
@ kFirstSeed
Definition Calendar.h:49
@ kSunsDawn
Definition Calendar.h:48
@ kSunsHeight
Definition Calendar.h:53
@ kHearthfire
Definition Calendar.h:55
@ kEveningStar
Definition Calendar.h:58
@ kSunsDusk
Definition Calendar.h:57
@ kFrostfall
Definition Calendar.h:56