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

#include <ThreatManager.h>

+ Inheritance diagram for ThreatReference:

Public Types

enum  TauntState : uint32 { TAUNT_STATE_DETAUNT = 0 , TAUNT_STATE_NONE = 1 , TAUNT_STATE_TAUNT = 2 }
 
enum  OnlineState { ONLINE_STATE_ONLINE = 2 , ONLINE_STATE_SUPPRESSED = 1 , ONLINE_STATE_OFFLINE = 0 }
 

Public Member Functions

CreatureGetOwner () const
 
UnitGetVictim () const
 
float GetThreat () const
 
OnlineState GetOnlineState () const
 
bool IsOnline () const
 
bool IsAvailable () const
 
bool IsSuppressed () const
 
bool IsOffline () const
 
TauntState GetTauntState () const
 
bool IsTaunting () const
 
bool IsDetaunted () const
 
void AddThreat (float amount)
 
void ScaleThreat (float factor)
 
void ModifyThreatByPercent (int32 percent)
 
void UpdateOffline ()
 
void ClearThreat ()
 
 ThreatReference (ThreatReference const &)=delete
 
ThreatReferenceoperator= (ThreatReference const &)=delete
 

Protected Member Functions

 ThreatReference (ThreatManager *mgr, Unit *victim)
 
virtual ~ThreatReference ()=default
 
void UnregisterAndFree ()
 
bool ShouldBeOffline () const
 
bool ShouldBeSuppressed () const
 
void UpdateTauntState (TauntState state=TAUNT_STATE_NONE)
 
void HeapNotifyIncreased ()
 
void HeapNotifyDecreased ()
 

Static Protected Member Functions

static bool FlagsAllowFighting (Unit const *a, Unit const *b)
 

Protected Attributes

Creature *const _owner
 
ThreatManager_mgr
 
Unit *const _victim
 
OnlineState _online
 
float _baseAmount
 
int32 _tempModifier
 
TauntState _taunted
 

Friends

class ThreatManager
 
struct CompareThreatLessThan
 

Detailed Description

Definition at line 260 of file ThreatManager.h.

Member Enumeration Documentation

◆ OnlineState

Enumerator
ONLINE_STATE_ONLINE 
ONLINE_STATE_SUPPRESSED 
ONLINE_STATE_OFFLINE 

Definition at line 264 of file ThreatManager.h.

◆ TauntState

Enumerator
TAUNT_STATE_DETAUNT 
TAUNT_STATE_NONE 
TAUNT_STATE_TAUNT 

Definition at line 263 of file ThreatManager.h.

Constructor & Destructor Documentation

◆ ThreatReference() [1/2]

ThreatReference::ThreatReference ( ThreatManager mgr,
Unit victim 
)
inlineexplicitprotected

Definition at line 288 of file ThreatManager.h.

◆ ~ThreatReference()

virtual ThreatReference::~ThreatReference ( )
protectedvirtualdefault

◆ ThreatReference() [2/2]

ThreatReference::ThreatReference ( ThreatReference const &  )
delete

Member Function Documentation

◆ AddThreat()

void ThreatReference::AddThreat ( float  amount)

Definition at line 43 of file ThreatManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearThreat()

void ThreatReference::ClearThreat ( )

Definition at line 147 of file ThreatManager.cpp.

+ Here is the call graph for this function:

◆ FlagsAllowFighting()

bool ThreatReference::FlagsAllowFighting ( Unit const *  a,
Unit const *  b 
)
staticprotected

Definition at line 87 of file ThreatManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetOnlineState()

OnlineState ThreatReference::GetOnlineState ( ) const
inline

Definition at line 269 of file ThreatManager.h.

+ Here is the caller graph for this function:

◆ GetOwner()

Creature * ThreatReference::GetOwner ( ) const
inline

Definition at line 266 of file ThreatManager.h.

◆ GetTauntState()

TauntState ThreatReference::GetTauntState ( ) const
inline

Definition at line 274 of file ThreatManager.h.

◆ GetThreat()

float ThreatReference::GetThreat ( ) const
inline

Definition at line 268 of file ThreatManager.h.

+ Here is the caller graph for this function:

◆ GetVictim()

Unit * ThreatReference::GetVictim ( ) const
inline

Definition at line 267 of file ThreatManager.h.

+ Here is the caller graph for this function:

◆ HeapNotifyDecreased()

void ThreatReference::HeapNotifyDecreased ( )
protected

Definition at line 172 of file ThreatManager.cpp.

+ Here is the caller graph for this function:

◆ HeapNotifyIncreased()

void ThreatReference::HeapNotifyIncreased ( )
protected

Definition at line 167 of file ThreatManager.cpp.

+ Here is the caller graph for this function:

◆ IsAvailable()

bool ThreatReference::IsAvailable ( ) const
inline

Definition at line 271 of file ThreatManager.h.

+ Here is the caller graph for this function:

◆ IsDetaunted()

bool ThreatReference::IsDetaunted ( ) const
inline

Definition at line 276 of file ThreatManager.h.

◆ IsOffline()

bool ThreatReference::IsOffline ( ) const
inline

Definition at line 273 of file ThreatManager.h.

+ Here is the caller graph for this function:

◆ IsOnline()

bool ThreatReference::IsOnline ( ) const
inline

Definition at line 270 of file ThreatManager.h.

+ Here is the caller graph for this function:

◆ IsSuppressed()

bool ThreatReference::IsSuppressed ( ) const
inline

Definition at line 272 of file ThreatManager.h.

◆ IsTaunting()

bool ThreatReference::IsTaunting ( ) const
inline

Definition at line 275 of file ThreatManager.h.

+ Here is the caller graph for this function:

◆ ModifyThreatByPercent()

void ThreatReference::ModifyThreatByPercent ( int32  percent)
inline

Definition at line 280 of file ThreatManager.h.

◆ operator=()

ThreatReference & ThreatReference::operator= ( ThreatReference const &  )
delete

◆ ScaleThreat()

void ThreatReference::ScaleThreat ( float  factor)

Definition at line 55 of file ThreatManager.cpp.

+ Here is the call graph for this function:

◆ ShouldBeOffline()

bool ThreatReference::ShouldBeOffline ( ) const
protected

Definition at line 104 of file ThreatManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ShouldBeSuppressed()

bool ThreatReference::ShouldBeSuppressed ( ) const
protected

Definition at line 115 of file ThreatManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UnregisterAndFree()

void ThreatReference::UnregisterAndFree ( )
protected

Definition at line 152 of file ThreatManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateOffline()

void ThreatReference::UpdateOffline ( )

Definition at line 67 of file ThreatManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateTauntState()

void ThreatReference::UpdateTauntState ( TauntState  state = TAUNT_STATE_NONE)
protected

Definition at line 128 of file ThreatManager.cpp.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ CompareThreatLessThan

friend struct CompareThreatLessThan
friend

Definition at line 317 of file ThreatManager.h.

◆ ThreatManager

friend class ThreatManager
friend

Definition at line 316 of file ThreatManager.h.

Member Data Documentation

◆ _baseAmount

float ThreatReference::_baseAmount
protected

Definition at line 308 of file ThreatManager.h.

◆ _mgr

ThreatManager& ThreatReference::_mgr
protected

Definition at line 303 of file ThreatManager.h.

◆ _online

OnlineState ThreatReference::_online
protected

Definition at line 307 of file ThreatManager.h.

◆ _owner

Creature* const ThreatReference::_owner
protected

Definition at line 302 of file ThreatManager.h.

◆ _taunted

TauntState ThreatReference::_taunted
protected

Definition at line 310 of file ThreatManager.h.

◆ _tempModifier

int32 ThreatReference::_tempModifier
protected

Definition at line 309 of file ThreatManager.h.

◆ _victim

Unit* const ThreatReference::_victim
protected

Definition at line 306 of file ThreatManager.h.


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