TrinityCore
|
#include <ThreatManager.h>
Classes | |
class | Heap |
class | ThreatListIterator |
Public Member Functions | |
ThreatManager (Unit *owner) | |
~ThreatManager () | |
void | Initialize () |
void | Update (uint32 tdiff) |
Unit * | GetOwner () const |
bool | CanHaveThreatList () const |
Unit * | GetCurrentVictim () |
Unit * | GetLastVictim () const |
Unit * | GetAnyTarget () const |
bool | IsThreatListEmpty (bool includeOffline=false) const |
bool | IsThreatenedBy (ObjectGuid const &who, bool includeOffline=false) const |
bool | IsThreatenedBy (Unit const *who, bool includeOffline=false) const |
float | GetThreat (Unit const *who, bool includeOffline=false) const |
size_t | GetThreatListSize () const |
Trinity::IteratorPair< ThreatListIterator, std::nullptr_t > | GetUnsortedThreatList () const |
Trinity::IteratorPair< ThreatListIterator, std::nullptr_t > | GetSortedThreatList () const |
std::vector< ThreatReference * > | GetModifiableThreatList () |
bool | IsThreateningAnyone (bool includeOffline=false) const |
bool | IsThreateningTo (ObjectGuid const &who, bool includeOffline=false) const |
bool | IsThreateningTo (Unit const *who, bool includeOffline=false) const |
auto const & | GetThreatenedByMeList () const |
void | EvaluateSuppressed (bool canExpire=false) |
void | AddThreat (Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false) |
== AFFECT MY THREAT LIST == More... | |
void | ScaleThreat (Unit *target, float factor) |
void | ModifyThreatByPercent (Unit *target, int32 percent) |
void | ResetThreat (Unit *target) |
void | MatchUnitThreatToHighestThreat (Unit *target) |
void | TauntUpdate () |
void | ResetAllThreat () |
void | ClearThreat (Unit *target) |
void | ClearThreat (ThreatReference *ref) |
void | ClearAllThreat () |
void | FixateTarget (Unit *target) |
void | ClearFixate () |
Unit * | GetFixateTarget () const |
void | ForwardThreatForAssistingMe (Unit *assistant, float baseAmount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false) |
== AFFECT OTHERS' THREAT LISTS == More... | |
void | RemoveMeFromThreatLists (bool(*unitFilter)(Unit const *otherUnit)) |
void | UpdateMyTempModifiers () |
void | UpdateMySpellSchoolModifiers () |
void | RegisterRedirectThreat (uint32 spellId, ObjectGuid const &victim, uint32 pct) |
== REDIRECT SYSTEM == More... | |
void | UnregisterRedirectThreat (uint32 spellId) |
void | UnregisterRedirectThreat (uint32 spellId, ObjectGuid const &victim) |
ThreatManager (ThreatManager const &)=delete | |
ThreatManager & | operator= (ThreatManager const &)=delete |
Static Public Member Functions | |
static bool | CanHaveThreatList (Unit const *who) |
Static Public Attributes | |
static const uint32 | THREAT_UPDATE_INTERVAL = 1000u |
Private Member Functions | |
void | SendClearAllThreatToClients () const |
void | SendRemoveToClients (Unit const *victim) const |
void | SendThreatListToClients (bool newHighest) const |
void | PutThreatListRef (ObjectGuid const &guid, ThreatReference *ref) |
== MY THREAT LIST == More... | |
void | PurgeThreatListRef (ObjectGuid const &guid) |
void | ProcessAIUpdates () |
void | RegisterForAIUpdate (ObjectGuid const &guid) |
void | UpdateVictim () |
ThreatReference const * | ReselectVictim () |
void | PutThreatenedByMeRef (ObjectGuid const &guid, ThreatReference *ref) |
== OTHERS' THREAT LISTS == More... | |
void | PurgeThreatenedByMeRef (ObjectGuid const &guid) |
void | UpdateRedirectInfo () |
Static Private Member Functions | |
static bool | CompareReferencesLT (ThreatReference const *a, ThreatReference const *b, float aWeight) |
static float | CalculateModifiedThreat (float threat, Unit const *victim, SpellInfo const *spell) |
Private Attributes | |
Unit *const | _owner |
bool | _ownerCanHaveThreatList |
bool | _needClientUpdate |
uint32 | _updateTimer |
std::unique_ptr< Heap > | _sortedThreatList |
std::unordered_map< ObjectGuid, ThreatReference * > | _myThreatListEntries |
std::vector< ObjectGuid > | _needsAIUpdate |
ThreatReference const * | _currentVictimRef |
ThreatReference const * | _fixateRef |
std::unordered_map< ObjectGuid, ThreatReference * > | _threatenedByMe |
std::array< float, MAX_SPELL_SCHOOL > | _singleSchoolModifiers |
std::unordered_map< std::underlying_type< SpellSchoolMask >::type, float > | _multiSchoolModifiers |
std::vector< std::pair< ObjectGuid, uint32 > > | _redirectInfo |
std::unordered_map< uint32, std::unordered_map< ObjectGuid, uint32 > > | _redirectRegistry |
Static Private Attributes | |
static const CompareThreatLessThan | CompareThreat |
Friends | |
class | ThreatReference |
class | ThreatReferenceImpl |
struct | CompareThreatLessThan |
class | debug_commandscript |
Definition at line 81 of file ThreatManager.h.
ThreatManager::ThreatManager | ( | Unit * | owner | ) |
Definition at line 192 of file ThreatManager.cpp.
ThreatManager::~ThreatManager | ( | ) |
|
delete |
void ThreatManager::AddThreat | ( | Unit * | target, |
float | amount, | ||
SpellInfo const * | spell = nullptr , |
||
bool | ignoreModifiers = false , |
||
bool | ignoreRedirects = false |
||
) |
== AFFECT MY THREAT LIST ==
Definition at line 353 of file ThreatManager.cpp.
|
staticprivate |
Definition at line 662 of file ThreatManager.cpp.
|
inline |
|
static |
Definition at line 172 of file ThreatManager.cpp.
void ThreatManager::ClearAllThreat | ( | ) |
Definition at line 538 of file ThreatManager.cpp.
|
inline |
void ThreatManager::ClearThreat | ( | ThreatReference * | ref | ) |
void ThreatManager::ClearThreat | ( | Unit * | target | ) |
Definition at line 523 of file ThreatManager.cpp.
|
staticprivate |
Definition at line 653 of file ThreatManager.cpp.
void ThreatManager::EvaluateSuppressed | ( | bool | canExpire = false | ) |
void ThreatManager::FixateTarget | ( | Unit * | target | ) |
Definition at line 549 of file ThreatManager.cpp.
void ThreatManager::ForwardThreatForAssistingMe | ( | Unit * | assistant, |
float | baseAmount, | ||
SpellInfo const * | spell = nullptr , |
||
bool | ignoreModifiers = false |
||
) |
== AFFECT OTHERS' THREAT LISTS ==
Definition at line 718 of file ThreatManager.cpp.
Unit * ThreatManager::GetAnyTarget | ( | ) | const |
Definition at line 239 of file ThreatManager.cpp.
Unit * ThreatManager::GetCurrentVictim | ( | ) |
Definition at line 224 of file ThreatManager.cpp.
Unit * ThreatManager::GetFixateTarget | ( | ) | const |
Definition at line 563 of file ThreatManager.cpp.
Unit * ThreatManager::GetLastVictim | ( | ) | const |
Definition at line 232 of file ThreatManager.cpp.
std::vector< ThreatReference * > ThreatManager::GetModifiableThreatList | ( | ) |
|
inline |
Trinity::IteratorPair< ThreatManager::ThreatListIterator, std::nullptr_t > ThreatManager::GetSortedThreatList | ( | ) | const |
float ThreatManager::GetThreat | ( | Unit const * | who, |
bool | includeOffline = false |
||
) | const |
Definition at line 266 of file ThreatManager.cpp.
|
inline |
size_t ThreatManager::GetThreatListSize | ( | ) | const |
Trinity::IteratorPair< ThreatManager::ThreatListIterator, std::nullptr_t > ThreatManager::GetUnsortedThreatList | ( | ) | const |
void ThreatManager::Initialize | ( | ) |
Definition at line 206 of file ThreatManager.cpp.
bool ThreatManager::IsThreatenedBy | ( | ObjectGuid const & | who, |
bool | includeOffline = false |
||
) | const |
bool ThreatManager::IsThreatenedBy | ( | Unit const * | who, |
bool | includeOffline = false |
||
) | const |
bool ThreatManager::IsThreateningAnyone | ( | bool | includeOffline = false | ) | const |
Definition at line 316 of file ThreatManager.cpp.
bool ThreatManager::IsThreateningTo | ( | ObjectGuid const & | who, |
bool | includeOffline = false |
||
) | const |
bool ThreatManager::IsThreateningTo | ( | Unit const * | who, |
bool | includeOffline = false |
||
) | const |
bool ThreatManager::IsThreatListEmpty | ( | bool | includeOffline = false | ) | const |
void ThreatManager::MatchUnitThreatToHighestThreat | ( | Unit * | target | ) |
Definition at line 474 of file ThreatManager.cpp.
|
delete |
|
private |
Definition at line 641 of file ThreatManager.cpp.
|
private |
|
private |
|
private |
== OTHERS' THREAT LISTS ==
Definition at line 894 of file ThreatManager.cpp.
|
private |
== MY THREAT LIST ==
Definition at line 870 of file ThreatManager.cpp.
|
inlineprivate |
void ThreatManager::RegisterRedirectThreat | ( | uint32 | spellId, |
ObjectGuid const & | victim, | ||
uint32 | pct | ||
) |
== REDIRECT SYSTEM ==
Definition at line 786 of file ThreatManager.cpp.
void ThreatManager::RemoveMeFromThreatLists | ( | bool(*)(Unit const *otherUnit) | unitFilter | ) |
|
private |
Definition at line 586 of file ThreatManager.cpp.
void ThreatManager::ResetAllThreat | ( | ) |
|
inline |
void ThreatManager::ScaleThreat | ( | Unit * | target, |
float | factor | ||
) |
|
private |
Definition at line 814 of file ThreatManager.cpp.
|
private |
Definition at line 824 of file ThreatManager.cpp.
|
private |
Definition at line 835 of file ThreatManager.cpp.
void ThreatManager::TauntUpdate | ( | ) |
Definition at line 494 of file ThreatManager.cpp.
void ThreatManager::UnregisterRedirectThreat | ( | uint32 | spellId | ) |
Definition at line 792 of file ThreatManager.cpp.
void ThreatManager::UnregisterRedirectThreat | ( | uint32 | spellId, |
ObjectGuid const & | victim | ||
) |
void ThreatManager::Update | ( | uint32 | tdiff | ) |
Definition at line 211 of file ThreatManager.cpp.
void ThreatManager::UpdateMySpellSchoolModifiers | ( | ) |
Definition at line 779 of file ThreatManager.cpp.
void ThreatManager::UpdateMyTempModifiers | ( | ) |
Definition at line 758 of file ThreatManager.cpp.
|
private |
|
private |
Definition at line 571 of file ThreatManager.cpp.
|
friend |
Definition at line 254 of file ThreatManager.h.
|
friend |
Definition at line 255 of file ThreatManager.h.
|
friend |
Definition at line 252 of file ThreatManager.h.
|
friend |
Definition at line 253 of file ThreatManager.h.
|
private |
Definition at line 213 of file ThreatManager.h.
|
private |
Definition at line 214 of file ThreatManager.h.
|
mutableprivate |
Definition at line 221 of file ThreatManager.h.
|
private |
Definition at line 202 of file ThreatManager.h.
|
private |
Definition at line 199 of file ThreatManager.h.
|
private |
Definition at line 208 of file ThreatManager.h.
|
private |
Definition at line 183 of file ThreatManager.h.
|
private |
Definition at line 184 of file ThreatManager.h.
|
private |
Definition at line 225 of file ThreatManager.h.
|
private |
Definition at line 226 of file ThreatManager.h.
|
private |
Definition at line 220 of file ThreatManager.h.
|
private |
Definition at line 201 of file ThreatManager.h.
|
private |
Definition at line 219 of file ThreatManager.h.
|
private |
Definition at line 200 of file ThreatManager.h.
|
staticprivate |
Definition at line 186 of file ThreatManager.h.
|
static |
Definition at line 86 of file ThreatManager.h.