TrinityCore
Loading...
Searching...
No Matches
WowTime Class Reference

#include <WowTime.h>

Public Member Functions

uint32 GetPackedTime () const
 
void SetPackedTime (uint32 packedTime)
 
std::time_t GetUnixTimeFromUtcTime () const
 
void SetUtcTimeFromUnixTime (std::time_t unixTime)
 
int32 GetYear () const
 
void SetYear (int32 year)
 
int8 GetMonth () const
 
void SetMonth (int8 month)
 
int8 GetMonthDay () const
 
void SetMonthDay (int8 monthDay)
 
int8 GetWeekDay () const
 
void SetWeekDay (int8 weekDay)
 
int8 GetHour () const
 
void SetHour (int8 hour)
 
int8 GetMinute () const
 
void SetMinute (int8 minute)
 
int8 GetFlags () const
 
void SetFlags (int8 flags)
 
int8 GetHolidayOffset () const
 
void SetHolidayOffset (int8 holidayOffset)
 
bool IsInRange (WowTime const &from, WowTime const &to) const
 
WowTime & operator+= (Seconds seconds)
 
WowTime operator+ (Seconds seconds) const
 
WowTime & operator-= (Seconds seconds)
 
WowTime operator- (Seconds seconds) const
 

Private Attributes

int32 _year = -1
 
int8 _month = -1
 
int8 _monthDay = -1
 
int8 _weekDay = -1
 
int8 _hour = -1
 
int8 _minute = -1
 
int8 _flags = -1
 
int8 _holidayOffset = 0
 

Friends

TC_GAME_API std::strong_ordering operator<=> (WowTime const &left, WowTime const &right)
 
TC_GAME_API bool operator== (WowTime const &left, WowTime const &right)
 
TC_GAME_API ByteBuffer & operator<< (ByteBuffer &data, WowTime const &wowTime)
 
TC_GAME_API ByteBuffer & operator>> (ByteBuffer &data, WowTime &wowTime)
 

Detailed Description

Definition at line 29 of file WowTime.h.

Member Function Documentation

◆ GetFlags()

int8 WowTime::GetFlags ( ) const
inline

Definition at line 56 of file WowTime.h.

References _flags.

◆ GetHolidayOffset()

int8 WowTime::GetHolidayOffset ( ) const
inline

Definition at line 59 of file WowTime.h.

References _holidayOffset.

◆ GetHour()

int8 WowTime::GetHour ( ) const
inline

Definition at line 50 of file WowTime.h.

References _hour.

◆ GetMinute()

int8 WowTime::GetMinute ( ) const
inline

Definition at line 53 of file WowTime.h.

References _minute.

◆ GetMonth()

int8 WowTime::GetMonth ( ) const
inline

Definition at line 41 of file WowTime.h.

References _month.

◆ GetMonthDay()

int8 WowTime::GetMonthDay ( ) const
inline

Definition at line 44 of file WowTime.h.

References _monthDay.

◆ GetPackedTime()

uint32 WowTime::GetPackedTime ( ) const

◆ GetUnixTimeFromUtcTime()

std::time_t WowTime::GetUnixTimeFromUtcTime ( ) const

◆ GetWeekDay()

int8 WowTime::GetWeekDay ( ) const
inline

Definition at line 47 of file WowTime.h.

References _weekDay.

◆ GetYear()

int32 WowTime::GetYear ( ) const
inline

Definition at line 38 of file WowTime.h.

References _year.

Referenced by GameEventMgr::SetHolidayEventTime().

◆ IsInRange()

bool WowTime::IsInRange ( WowTime const &  from,
WowTime const &  to 
) const

Definition at line 173 of file WowTime.cpp.

◆ operator+()

WowTime WowTime::operator+ ( Seconds  seconds) const

Definition at line 189 of file WowTime.cpp.

◆ operator+=()

WowTime & WowTime::operator+= ( Seconds  seconds)

Definition at line 181 of file WowTime.cpp.

References GetUnixTimeFromUtcTime(), and SetUtcTimeFromUnixTime().

◆ operator-()

WowTime WowTime::operator- ( Seconds  seconds) const

Definition at line 202 of file WowTime.cpp.

◆ operator-=()

WowTime & WowTime::operator-= ( Seconds  seconds)

Definition at line 194 of file WowTime.cpp.

References GetUnixTimeFromUtcTime(), and SetUtcTimeFromUnixTime().

◆ SetFlags()

void WowTime::SetFlags ( int8  flags)

Definition at line 136 of file WowTime.cpp.

References _flags, ASSERT, and flags.

◆ SetHolidayOffset()

void WowTime::SetHolidayOffset ( int8  holidayOffset)
inline

Definition at line 60 of file WowTime.h.

References _holidayOffset.

◆ SetHour()

void WowTime::SetHour ( int8  hour)

Definition at line 124 of file WowTime.cpp.

References _hour, and ASSERT.

◆ SetMinute()

void WowTime::SetMinute ( int8  minute)

Definition at line 130 of file WowTime.cpp.

References _minute, and ASSERT.

◆ SetMonth()

void WowTime::SetMonth ( int8  month)

Definition at line 106 of file WowTime.cpp.

References _month, and ASSERT.

◆ SetMonthDay()

void WowTime::SetMonthDay ( int8  monthDay)

Definition at line 112 of file WowTime.cpp.

References _monthDay, and ASSERT.

◆ SetPackedTime()

void WowTime::SetPackedTime ( uint32  packedTime)

◆ SetUtcTimeFromUnixTime()

◆ SetWeekDay()

void WowTime::SetWeekDay ( int8  weekDay)

Definition at line 118 of file WowTime.cpp.

References _weekDay, and ASSERT.

◆ SetYear()

void WowTime::SetYear ( int32  year)

Definition at line 100 of file WowTime.cpp.

References _year, and ASSERT.

Referenced by GameEventMgr::SetHolidayEventTime().

Friends And Related Symbol Documentation

◆ operator<<

TC_GAME_API ByteBuffer & operator<< ( ByteBuffer &  data,
WowTime const &  wowTime 
)
friend

Definition at line 207 of file WowTime.cpp.

◆ operator<=>

TC_GAME_API std::strong_ordering operator<=> ( WowTime const &  left,
WowTime const &  right 
)
friend

Definition at line 142 of file WowTime.cpp.

◆ operator==

TC_GAME_API bool operator== ( WowTime const &  left,
WowTime const &  right 
)
friend

Definition at line 63 of file WowTime.h.

◆ operator>>

TC_GAME_API ByteBuffer & operator>> ( ByteBuffer &  data,
WowTime &  wowTime 
)
friend

Definition at line 213 of file WowTime.cpp.

Member Data Documentation

◆ _flags

int8 WowTime::_flags = -1
private

Definition at line 86 of file WowTime.h.

Referenced by GetFlags(), GetPackedTime(), SetFlags(), and SetPackedTime().

◆ _holidayOffset

int8 WowTime::_holidayOffset = 0
private

Definition at line 87 of file WowTime.h.

Referenced by GetHolidayOffset(), and SetHolidayOffset().

◆ _hour

int8 WowTime::_hour = -1
private

◆ _minute

int8 WowTime::_minute = -1
private

◆ _month

int8 WowTime::_month = -1
private

◆ _monthDay

int8 WowTime::_monthDay = -1
private

◆ _weekDay

int8 WowTime::_weekDay = -1
private

◆ _year

int32 WowTime::_year = -1
private

The documentation for this class was generated from the following files: