TrinityCore
CriteriaHandler Class Referenceabstract

#include <CriteriaHandler.h>

+ Inheritance diagram for CriteriaHandler:

Public Member Functions

 CriteriaHandler ()
 
virtual ~CriteriaHandler ()
 
 CriteriaHandler (CriteriaHandler const &right)=delete
 
 CriteriaHandler (CriteriaHandler &&right)=delete
 
CriteriaHandleroperator= (CriteriaHandler const &right)=delete
 
CriteriaHandleroperator= (CriteriaHandler &&right)=delete
 
virtual void Reset ()
 
void UpdateCriteria (CriteriaType type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, WorldObject const *ref=nullptr, Player *referencePlayer=nullptr)
 
virtual void SendAllData (Player const *receiver) const =0
 
void UpdateTimedCriteria (Milliseconds timeDiff)
 
void StartCriteria (CriteriaStartEvent startEvent, uint32 entry, Milliseconds timeLost=Milliseconds::zero())
 
virtual void FailCriteria (CriteriaFailEvent failEvent, uint32 asset)
 

Protected Member Functions

virtual void SendCriteriaUpdate (Criteria const *criteria, CriteriaProgress const *progress, Seconds timeElapsed, bool timedCompleted) const =0
 
CriteriaProgressGetCriteriaProgress (Criteria const *entry)
 
void SetCriteriaProgress (Criteria const *criteria, uint64 changeValue, Player *referencePlayer, ProgressType progressType=PROGRESS_SET)
 
void RemoveCriteriaProgress (Criteria const *criteria)
 
virtual void SendCriteriaProgressRemoved (uint32 criteriaId)=0
 
bool IsCompletedCriteriaTree (CriteriaTree const *tree)
 
virtual bool CanUpdateCriteriaTree (Criteria const *criteria, CriteriaTree const *tree, Player *referencePlayer) const
 
virtual bool CanCompleteCriteriaTree (CriteriaTree const *tree)
 
virtual void CompletedCriteriaTree (CriteriaTree const *tree, Player *referencePlayer)=0
 
virtual void AfterCriteriaTreeUpdate (CriteriaTree const *, Player *)
 
bool IsCompletedCriteria (Criteria const *criteria, uint64 requiredAmount)
 
bool CanUpdateCriteria (Criteria const *criteria, CriteriaTreeList const *trees, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, WorldObject const *ref, Player *referencePlayer)
 
virtual void SendPacket (WorldPacket const *data) const =0
 
bool ConditionsSatisfied (Criteria const *criteria, Player *referencePlayer) const
 
bool RequirementsSatisfied (Criteria const *criteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, WorldObject const *ref, Player *referencePlayer) const
 
virtual bool RequiredAchievementSatisfied (uint32) const
 
bool ModifierTreeSatisfied (ModifierTreeNode const *parent, uint64 miscValue1, uint64 miscValue2, WorldObject const *ref, Player *referencePlayer) const
 
bool ModifierSatisfied (ModifierTreeEntry const *modifier, uint64 miscValue1, uint64 miscValue2, WorldObject const *ref, Player *referencePlayer) const
 
virtual std::string GetOwnerInfo () const =0
 
virtual CriteriaList const & GetCriteriaByType (CriteriaType type, uint32 asset) const =0
 

Protected Attributes

CriteriaProgressMap _criteriaProgress
 
std::unordered_map< uint32, Milliseconds_startedCriteria
 

Detailed Description

Definition at line 263 of file CriteriaHandler.h.

Constructor & Destructor Documentation

◆ CriteriaHandler() [1/3]

CriteriaHandler::CriteriaHandler ( )

Definition at line 449 of file CriteriaHandler.cpp.

◆ ~CriteriaHandler()

CriteriaHandler::~CriteriaHandler ( )
virtual

Definition at line 451 of file CriteriaHandler.cpp.

◆ CriteriaHandler() [2/3]

CriteriaHandler::CriteriaHandler ( CriteriaHandler const &  right)
delete

◆ CriteriaHandler() [3/3]

CriteriaHandler::CriteriaHandler ( CriteriaHandler &&  right)
delete

Member Function Documentation

◆ AfterCriteriaTreeUpdate()

virtual void CriteriaHandler::AfterCriteriaTreeUpdate ( CriteriaTree const *  ,
Player  
)
inlineprotectedvirtual

Reimplemented in Scenario, and AchievementMgr.

Definition at line 296 of file CriteriaHandler.h.

+ Here is the caller graph for this function:

◆ CanCompleteCriteriaTree()

bool CriteriaHandler::CanCompleteCriteriaTree ( CriteriaTree const *  tree)
protectedvirtual

Reimplemented in AchievementMgr, QuestObjectiveCriteriaMgr, and Scenario.

Definition at line 1146 of file CriteriaHandler.cpp.

+ Here is the caller graph for this function:

◆ CanUpdateCriteria()

bool CriteriaHandler::CanUpdateCriteria ( Criteria const *  criteria,
CriteriaTreeList const *  trees,
uint64  miscValue1,
uint64  miscValue2,
uint64  miscValue3,
WorldObject const *  ref,
Player referencePlayer 
)
protected

Definition at line 1287 of file CriteriaHandler.cpp.

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

◆ CanUpdateCriteriaTree()

bool CriteriaHandler::CanUpdateCriteriaTree ( Criteria const *  criteria,
CriteriaTree const *  tree,
Player referencePlayer 
) const
protectedvirtual

Reimplemented in AchievementMgr, QuestObjectiveCriteriaMgr, and Scenario.

Definition at line 1133 of file CriteriaHandler.cpp.

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

◆ CompletedCriteriaTree()

virtual void CriteriaHandler::CompletedCriteriaTree ( CriteriaTree const *  tree,
Player referencePlayer 
)
protectedpure virtual

Implemented in AchievementMgr, QuestObjectiveCriteriaMgr, and Scenario.

+ Here is the caller graph for this function:

◆ ConditionsSatisfied()

bool CriteriaHandler::ConditionsSatisfied ( Criteria const *  criteria,
Player referencePlayer 
) const
protected

Definition at line 1333 of file CriteriaHandler.cpp.

+ Here is the caller graph for this function:

◆ FailCriteria()

void CriteriaHandler::FailCriteria ( CriteriaFailEvent  failEvent,
uint32  asset 
)
virtual

Definition at line 924 of file CriteriaHandler.cpp.

+ Here is the call graph for this function:

◆ GetCriteriaByType()

virtual CriteriaList const & CriteriaHandler::GetCriteriaByType ( CriteriaType  type,
uint32  asset 
) const
protectedpure virtual

Implemented in PlayerAchievementMgr, GuildAchievementMgr, QuestObjectiveCriteriaMgr, and Scenario.

+ Here is the caller graph for this function:

◆ GetCriteriaProgress()

CriteriaProgress * CriteriaHandler::GetCriteriaProgress ( Criteria const *  entry)
protected

Definition at line 957 of file CriteriaHandler.cpp.

+ Here is the caller graph for this function:

◆ GetOwnerInfo()

virtual std::string CriteriaHandler::GetOwnerInfo ( ) const
protectedpure virtual

Implemented in PlayerAchievementMgr, GuildAchievementMgr, QuestObjectiveCriteriaMgr, and InstanceScenario.

+ Here is the caller graph for this function:

◆ IsCompletedCriteria()

bool CriteriaHandler::IsCompletedCriteria ( Criteria const *  criteria,
uint64  requiredAmount 
)
protected

Definition at line 1151 of file CriteriaHandler.cpp.

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

◆ IsCompletedCriteriaTree()

bool CriteriaHandler::IsCompletedCriteriaTree ( CriteriaTree const *  tree)
protected

Definition at line 1053 of file CriteriaHandler.cpp.

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

◆ ModifierSatisfied()

bool CriteriaHandler::ModifierSatisfied ( ModifierTreeEntry const *  modifier,
uint64  miscValue1,
uint64  miscValue2,
WorldObject const *  ref,
Player referencePlayer 
) const
protected

Definition at line 1686 of file CriteriaHandler.cpp.

+ Here is the caller graph for this function:

◆ ModifierTreeSatisfied()

bool CriteriaHandler::ModifierTreeSatisfied ( ModifierTreeNode const *  parent,
uint64  miscValue1,
uint64  miscValue2,
WorldObject const *  ref,
Player referencePlayer 
) const
protected

Definition at line 1656 of file CriteriaHandler.cpp.

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

◆ operator=() [1/2]

CriteriaHandler & CriteriaHandler::operator= ( CriteriaHandler &&  right)
delete

◆ operator=() [2/2]

CriteriaHandler & CriteriaHandler::operator= ( CriteriaHandler const &  right)
delete

◆ RemoveCriteriaProgress()

void CriteriaHandler::RemoveCriteriaProgress ( Criteria const *  criteria)
protected

Definition at line 1038 of file CriteriaHandler.cpp.

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

◆ RequiredAchievementSatisfied()

virtual bool CriteriaHandler::RequiredAchievementSatisfied ( uint32  ) const
inlineprotectedvirtual

Reimplemented in AchievementMgr, and QuestObjectiveCriteriaMgr.

Definition at line 305 of file CriteriaHandler.h.

+ Here is the caller graph for this function:

◆ RequirementsSatisfied()

bool CriteriaHandler::RequirementsSatisfied ( Criteria const *  criteria,
uint64  miscValue1,
uint64  miscValue2,
uint64  miscValue3,
WorldObject const *  ref,
Player referencePlayer 
) const
protected

Definition at line 1341 of file CriteriaHandler.cpp.

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

◆ Reset()

void CriteriaHandler::Reset ( )
virtual

Reimplemented in PlayerAchievementMgr, GuildAchievementMgr, QuestObjectiveCriteriaMgr, and Scenario.

Definition at line 453 of file CriteriaHandler.cpp.

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

◆ SendAllData()

virtual void CriteriaHandler::SendAllData ( Player const *  receiver) const
pure virtual

◆ SendCriteriaProgressRemoved()

virtual void CriteriaHandler::SendCriteriaProgressRemoved ( uint32  criteriaId)
protectedpure virtual

Implemented in PlayerAchievementMgr, GuildAchievementMgr, QuestObjectiveCriteriaMgr, and Scenario.

+ Here is the caller graph for this function:

◆ SendCriteriaUpdate()

virtual void CriteriaHandler::SendCriteriaUpdate ( Criteria const *  criteria,
CriteriaProgress const *  progress,
Seconds  timeElapsed,
bool  timedCompleted 
) const
protectedpure virtual

Implemented in Scenario, PlayerAchievementMgr, GuildAchievementMgr, and QuestObjectiveCriteriaMgr.

+ Here is the caller graph for this function:

◆ SendPacket()

virtual void CriteriaHandler::SendPacket ( WorldPacket const *  data) const
protectedpure virtual

◆ SetCriteriaProgress()

void CriteriaHandler::SetCriteriaProgress ( Criteria const *  criteria,
uint64  changeValue,
Player referencePlayer,
ProgressType  progressType = PROGRESS_SET 
)
protected

Definition at line 966 of file CriteriaHandler.cpp.

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

◆ StartCriteria()

void CriteriaHandler::StartCriteria ( CriteriaStartEvent  startEvent,
uint32  entry,
Milliseconds  timeLost = Milliseconds::zero() 
)

Definition at line 884 of file CriteriaHandler.cpp.

+ Here is the call graph for this function:

◆ UpdateCriteria()

void CriteriaHandler::UpdateCriteria ( CriteriaType  type,
uint64  miscValue1 = 0,
uint64  miscValue2 = 0,
uint64  miscValue3 = 0,
WorldObject const *  ref = nullptr,
Player referencePlayer = nullptr 
)

this function will be called whenever the user might have done a criteria relevant action

Definition at line 464 of file CriteriaHandler.cpp.

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

◆ UpdateTimedCriteria()

void CriteriaHandler::UpdateTimedCriteria ( Milliseconds  timeDiff)

Definition at line 865 of file CriteriaHandler.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _criteriaProgress

CriteriaProgressMap CriteriaHandler::_criteriaProgress
protected

Definition at line 312 of file CriteriaHandler.h.

◆ _startedCriteria

std::unordered_map<uint32 , Milliseconds > CriteriaHandler::_startedCriteria
protected

Definition at line 313 of file CriteriaHandler.h.


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