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

#include <MirrorTimer.h>

Public Types

enum class  UpdateResult : uint8 {
  Inactive , Decreased , DecreasedExpired , ExpiredTicked ,
  Regenerated
}
 

Public Member Functions

bool IsActive () const
 
bool IsRegenerating () const
 
int32 GetValue () const
 
void SetValue (int32 value)
 
int32 GetMaxValue () const
 
void SetMaxValue (int32 maxValue)
 
int32 GetScale () const
 
void SetScale (int32 scale)
 
int32 GetSpellId () const
 
bool IsPaused () const
 
void SetPaused (bool state)
 
bool IsChanged () const
 
bool IsPausedChanged () const
 
void ClearChanged ()
 
void Start (int32 maxValue, int32 spellId)
 
void Start (int32 value, int32 maxValue, int32 spellId)
 
void Stop ()
 
UpdateResult Update (uint32 diff)
 

Private Attributes

int32 m_value = 0
 
int32 m_maxValue = 0
 
int32 m_scale = -1
 
int32 m_spellId = 0
 
EnumFlag< MirrorTimerFlags > m_flags = MirrorTimerFlags::None
 
PeriodicTimer m_expiredTick { ExpiredTickPeriod.count(), ExpiredTickPeriod.count() }
 

Static Private Attributes

static constexpr Milliseconds ExpiredTickPeriod = 1s
 

Detailed Description

Definition at line 44 of file MirrorTimer.h.

Member Enumeration Documentation

◆ UpdateResult

enum class MirrorTimer::UpdateResult : uint8
strong
Enumerator
Inactive 
Decreased 
DecreasedExpired 
ExpiredTicked 
Regenerated 

Definition at line 73 of file MirrorTimer.h.

Member Function Documentation

◆ ClearChanged()

void MirrorTimer::ClearChanged ( )
inline

Definition at line 66 of file MirrorTimer.h.

References Changed, m_flags, PausedChanged, and EnumFlag< T >::RemoveFlag().

Referenced by Player::UpdateMirrorTimers().

◆ GetMaxValue()

int32 MirrorTimer::GetMaxValue ( ) const
inline

Definition at line 53 of file MirrorTimer.h.

References m_maxValue.

Referenced by SetMaxValue(), Update(), and Player::UpdateMirrorTimers().

◆ GetScale()

int32 MirrorTimer::GetScale ( ) const
inline

Definition at line 56 of file MirrorTimer.h.

References m_scale.

Referenced by SetScale(), Update(), and Player::UpdateMirrorTimers().

◆ GetSpellId()

int32 MirrorTimer::GetSpellId ( ) const
inline

Definition at line 59 of file MirrorTimer.h.

References m_spellId.

Referenced by Player::UpdateMirrorTimers().

◆ GetValue()

int32 MirrorTimer::GetValue ( ) const
inline

Definition at line 50 of file MirrorTimer.h.

References m_value.

Referenced by SetMaxValue(), SetValue(), Update(), and Player::UpdateMirrorTimers().

◆ IsActive()

bool MirrorTimer::IsActive ( ) const
inline

◆ IsChanged()

bool MirrorTimer::IsChanged ( ) const
inline

Definition at line 64 of file MirrorTimer.h.

References Changed, EnumFlag< T >::HasFlag(), and m_flags.

Referenced by Player::UpdateMirrorTimers().

◆ IsPaused()

bool MirrorTimer::IsPaused ( ) const
inline

Definition at line 61 of file MirrorTimer.h.

References EnumFlag< T >::HasFlag(), IsRegenerating(), m_flags, and Paused.

Referenced by SetPaused(), Update(), and Player::UpdateMirrorTimers().

◆ IsPausedChanged()

bool MirrorTimer::IsPausedChanged ( ) const
inline

Definition at line 65 of file MirrorTimer.h.

References EnumFlag< T >::HasFlag(), m_flags, and PausedChanged.

Referenced by Player::UpdateMirrorTimers().

◆ IsRegenerating()

bool MirrorTimer::IsRegenerating ( ) const
inline

Definition at line 48 of file MirrorTimer.h.

References m_scale.

Referenced by IsPaused().

◆ SetMaxValue()

void MirrorTimer::SetMaxValue ( int32  maxValue)

Definition at line 28 of file MirrorTimer.cpp.

References Changed, GetMaxValue(), GetValue(), IsActive(), m_flags, m_maxValue, SetValue(), and Stop().

◆ SetPaused()

void MirrorTimer::SetPaused ( bool  state)

Definition at line 54 of file MirrorTimer.cpp.

References IsActive(), IsPaused(), m_flags, Paused, and PausedChanged.

Referenced by SetScale().

◆ SetScale()

void MirrorTimer::SetScale ( int32  scale)

Definition at line 43 of file MirrorTimer.cpp.

References Changed, GetScale(), IsActive(), m_flags, m_scale, and SetPaused().

◆ SetValue()

void MirrorTimer::SetValue ( int32  value)

Definition at line 20 of file MirrorTimer.cpp.

References Changed, GetValue(), IsActive(), m_flags, and m_value.

Referenced by SetMaxValue().

◆ Start() [1/2]

void MirrorTimer::Start ( int32  maxValue,
int32  spellId 
)

◆ Start() [2/2]

void MirrorTimer::Start ( int32  value,
int32  maxValue,
int32  spellId 
)

Definition at line 79 of file MirrorTimer.cpp.

References IsActive(), m_value, and Start().

◆ Stop()

void MirrorTimer::Stop ( )

Definition at line 87 of file MirrorTimer.cpp.

References Changed, IsActive(), m_flags, m_maxValue, and m_value.

Referenced by SetMaxValue(), Start(), Update(), and Player::UpdateMirrorTimers().

◆ Update()

Member Data Documentation

◆ ExpiredTickPeriod

constexpr Milliseconds MirrorTimer::ExpiredTickPeriod = 1s
staticconstexprprivate

Definition at line 91 of file MirrorTimer.h.

Referenced by Start(), and Update().

◆ m_expiredTick

PeriodicTimer MirrorTimer::m_expiredTick { ExpiredTickPeriod.count(), ExpiredTickPeriod.count() }
private

Definition at line 92 of file MirrorTimer.h.

Referenced by Start(), and Update().

◆ m_flags

◆ m_maxValue

int32 MirrorTimer::m_maxValue = 0
private

Definition at line 86 of file MirrorTimer.h.

Referenced by GetMaxValue(), IsActive(), SetMaxValue(), Start(), and Stop().

◆ m_scale

int32 MirrorTimer::m_scale = -1
private

Definition at line 87 of file MirrorTimer.h.

Referenced by GetScale(), IsRegenerating(), SetScale(), and Start().

◆ m_spellId

int32 MirrorTimer::m_spellId = 0
private

Definition at line 88 of file MirrorTimer.h.

Referenced by GetSpellId(), and Start().

◆ m_value

int32 MirrorTimer::m_value = 0
private

Definition at line 85 of file MirrorTimer.h.

Referenced by GetValue(), SetValue(), Start(), Start(), Stop(), and Update().


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