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

#include <CombatManager.h>

Public Member Functions

 CombatManager (Unit *owner)
 
 ~CombatManager ()
 
void Update (uint32 tdiff)
 
UnitGetOwner () const
 
bool HasCombat () const
 
bool HasPvECombat () const
 
bool HasPvECombatWithPlayers () const
 
std::unordered_map< ObjectGuid, CombatReference * > const & GetPvECombatRefs () const
 
bool HasPvPCombat () const
 
std::unordered_map< ObjectGuid, PvPCombatReference * > const & GetPvPCombatRefs () const
 
UnitGetAnyTarget () const
 
bool SetInCombatWith (Unit *who, bool addSecondUnitSuppressed=false)
 
bool IsInCombatWith (ObjectGuid const &who) const
 
bool IsInCombatWith (Unit const *who) const
 
void InheritCombatStatesFrom (Unit const *who)
 
void EndCombatBeyondRange (float range, bool includingPvP=false)
 
void SuppressPvPCombat ()
 
void EndAllPvECombat ()
 
void RevalidateCombat ()
 
void EndAllPvPCombat ()
 
void EndAllCombat ()
 
 CombatManager (CombatManager const &)=delete
 
CombatManageroperator= (CombatManager const &)=delete
 

Static Public Member Functions

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

Private Member Functions

void PutReference (ObjectGuid const &guid, CombatReference *ref)
 
void PurgeReference (ObjectGuid const &guid, bool pvp)
 
bool UpdateOwnerCombatState () const
 

Static Private Member Functions

static void NotifyAICombat (Unit *me, Unit *other)
 

Private Attributes

Unit *const _owner
 
std::unordered_map< ObjectGuid, CombatReference * > _pveRefs
 
std::unordered_map< ObjectGuid, PvPCombatReference * > _pvpRefs
 

Friends

struct CombatReference
 
struct PvPCombatReference
 

Detailed Description

Definition at line 98 of file CombatManager.h.

Constructor & Destructor Documentation

◆ CombatManager() [1/2]

CombatManager::CombatManager ( Unit owner)
inline

Definition at line 103 of file CombatManager.h.

◆ ~CombatManager()

CombatManager::~CombatManager ( )

Definition at line 130 of file CombatManager.cpp.

+ Here is the call graph for this function:

◆ CombatManager() [2/2]

CombatManager::CombatManager ( CombatManager const &  )
delete

Member Function Documentation

◆ CanBeginCombat()

bool CombatManager::CanBeginCombat ( Unit const *  a,
Unit const *  b 
)
static

Definition at line 25 of file CombatManager.cpp.

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

◆ EndAllCombat()

void CombatManager::EndAllCombat ( )
inline

Definition at line 128 of file CombatManager.h.

+ Here is the caller graph for this function:

◆ EndAllPvECombat()

void CombatManager::EndAllPvECombat ( )

Definition at line 308 of file CombatManager.cpp.

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

◆ EndAllPvPCombat()

void CombatManager::EndAllPvPCombat ( )

Definition at line 346 of file CombatManager.cpp.

◆ EndCombatBeyondRange()

void CombatManager::EndCombatBeyondRange ( float  range,
bool  includingPvP = false 
)

Definition at line 267 of file CombatManager.cpp.

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

◆ GetAnyTarget()

Unit * CombatManager::GetAnyTarget ( ) const

Definition at line 177 of file CombatManager.cpp.

+ Here is the caller graph for this function:

◆ GetOwner()

Unit * CombatManager::GetOwner ( ) const
inline

Definition at line 107 of file CombatManager.h.

◆ GetPvECombatRefs()

std::unordered_map< ObjectGuid, CombatReference * > const & CombatManager::GetPvECombatRefs ( ) const
inline

Definition at line 111 of file CombatManager.h.

+ Here is the caller graph for this function:

◆ GetPvPCombatRefs()

std::unordered_map< ObjectGuid, PvPCombatReference * > const & CombatManager::GetPvPCombatRefs ( ) const
inline

Definition at line 113 of file CombatManager.h.

+ Here is the caller graph for this function:

◆ HasCombat()

bool CombatManager::HasCombat ( ) const
inline

Definition at line 108 of file CombatManager.h.

+ Here is the caller graph for this function:

◆ HasPvECombat()

bool CombatManager::HasPvECombat ( ) const

Definition at line 152 of file CombatManager.cpp.

+ Here is the caller graph for this function:

◆ HasPvECombatWithPlayers()

bool CombatManager::HasPvECombatWithPlayers ( ) const

Definition at line 160 of file CombatManager.cpp.

+ Here is the caller graph for this function:

◆ HasPvPCombat()

bool CombatManager::HasPvPCombat ( ) const

Definition at line 169 of file CombatManager.cpp.

+ Here is the caller graph for this function:

◆ InheritCombatStatesFrom()

void CombatManager::InheritCombatStatesFrom ( Unit const *  who)

Definition at line 243 of file CombatManager.cpp.

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

◆ IsInCombatWith() [1/2]

bool CombatManager::IsInCombatWith ( ObjectGuid const &  who) const

Definition at line 233 of file CombatManager.cpp.

+ Here is the caller graph for this function:

◆ IsInCombatWith() [2/2]

bool CombatManager::IsInCombatWith ( Unit const *  who) const

Definition at line 238 of file CombatManager.cpp.

+ Here is the call graph for this function:

◆ NotifyAICombat()

void CombatManager::NotifyAICombat ( Unit me,
Unit other 
)
staticprivate

Definition at line 352 of file CombatManager.cpp.

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

◆ operator=()

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

◆ PurgeReference()

void CombatManager::PurgeReference ( ObjectGuid const &  guid,
bool  pvp 
)
private

Definition at line 374 of file CombatManager.cpp.

+ Here is the caller graph for this function:

◆ PutReference()

void CombatManager::PutReference ( ObjectGuid const &  guid,
CombatReference ref 
)
private

Definition at line 358 of file CombatManager.cpp.

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

◆ RevalidateCombat()

void CombatManager::RevalidateCombat ( )

Definition at line 317 of file CombatManager.cpp.

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

◆ SetInCombatWith()

bool CombatManager::SetInCombatWith ( Unit who,
bool  addSecondUnitSuppressed = false 
)

Definition at line 188 of file CombatManager.cpp.

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

◆ SuppressPvPCombat()

void CombatManager::SuppressPvPCombat ( )

Definition at line 299 of file CombatManager.cpp.

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

◆ Update()

void CombatManager::Update ( uint32  tdiff)

Definition at line 136 of file CombatManager.cpp.

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

◆ UpdateOwnerCombatState()

bool CombatManager::UpdateOwnerCombatState ( ) const
private

Definition at line 382 of file CombatManager.cpp.

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

Friends And Related Symbol Documentation

◆ CombatReference

friend struct CombatReference
friend

Definition at line 142 of file CombatManager.h.

◆ PvPCombatReference

friend struct PvPCombatReference
friend

Definition at line 143 of file CombatManager.h.

Member Data Documentation

◆ _owner

Unit* const CombatManager::_owner
private

Definition at line 138 of file CombatManager.h.

◆ _pveRefs

std::unordered_map<ObjectGuid, CombatReference*> CombatManager::_pveRefs
private

Definition at line 139 of file CombatManager.h.

◆ _pvpRefs

std::unordered_map<ObjectGuid, PvPCombatReference*> CombatManager::_pvpRefs
private

Definition at line 140 of file CombatManager.h.


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