TrinityCore
Scenario Class Reference

#include <Scenario.h>

+ Inheritance diagram for Scenario:

Public Member Functions

 Scenario (Map *map, ScenarioData const *scenarioData)
 
 ~Scenario ()
 
void Reset () override
 
void SetStep (ScenarioStepEntry const *step)
 
virtual void CompleteStep (ScenarioStepEntry const *step)
 
virtual void CompleteScenario ()
 
virtual void OnPlayerEnter (Player *player)
 
virtual void OnPlayerExit (Player *player)
 
virtual void Update (uint32)
 
bool IsComplete () const
 
bool IsCompletedStep (ScenarioStepEntry const *step)
 
void SetStepState (ScenarioStepEntry const *step, ScenarioStepState state)
 
ScenarioEntry const * GetEntry () const
 
ScenarioStepState GetStepState (ScenarioStepEntry const *step) const
 
ScenarioStepEntry const * GetStep () const
 
ScenarioStepEntry const * GetFirstStep () const
 
ScenarioStepEntry const * GetLastStep () const
 
void SendScenarioState (Player const *player) const
 
void SendBootPlayer (Player const *player) const
 
- Public Member Functions inherited from CriteriaHandler
 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

void SendCriteriaUpdate (Criteria const *criteria, CriteriaProgress const *progress, Seconds timeElapsed, bool timedCompleted) const override
 
void SendCriteriaProgressRemoved (uint32) override
 
bool CanUpdateCriteriaTree (Criteria const *criteria, CriteriaTree const *tree, Player *referencePlayer) const override
 
bool CanCompleteCriteriaTree (CriteriaTree const *tree) override
 
void CompletedCriteriaTree (CriteriaTree const *tree, Player *referencePlayer) override
 
void AfterCriteriaTreeUpdate (CriteriaTree const *, Player *) override
 
void DoForAllPlayers (std::function< void(Player *)> const &worker) const
 
void SendPacket (WorldPacket const *data) const override
 
void SendAllData (Player const *) const override
 
void BuildScenarioStateFor (Player const *player, WorldPackets::Scenario::ScenarioState *scenarioState) const
 
std::vector< WorldPackets::Scenario::BonusObjectiveDataGetBonusObjectivesData () const
 
std::vector< WorldPackets::Achievement::CriteriaProgressGetCriteriasProgressFor (Player const *player) const
 
CriteriaList const & GetCriteriaByType (CriteriaType type, uint32 asset) const override
 
- Protected Member Functions inherited from CriteriaHandler
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

Map const * _map
 
GuidUnorderedSet _players
 
ScenarioData const * _data
 
- Protected Attributes inherited from CriteriaHandler
CriteriaProgressMap _criteriaProgress
 
std::unordered_map< uint32, Milliseconds_startedCriteria
 

Private Attributes

ObjectGuid const _guid
 
ScenarioStepEntry const * _currentstep
 
std::map< ScenarioStepEntry const *, ScenarioStepState_stepStates
 

Detailed Description

Definition at line 52 of file Scenario.h.

Constructor & Destructor Documentation

◆ Scenario()

Scenario::Scenario ( Map map,
ScenarioData const *  scenarioData 
)

Definition at line 28 of file Scenario.cpp.

+ Here is the call graph for this function:

◆ ~Scenario()

Scenario::~Scenario ( )

Definition at line 43 of file Scenario.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ AfterCriteriaTreeUpdate()

void Scenario::AfterCriteriaTreeUpdate ( CriteriaTree const *  ,
Player  
)
inlineoverrideprotectedvirtual

Reimplemented from CriteriaHandler.

Definition at line 90 of file Scenario.h.

◆ BuildScenarioStateFor()

void Scenario::BuildScenarioStateFor ( Player const *  player,
WorldPackets::Scenario::ScenarioState scenarioState 
) const
protected

Definition at line 246 of file Scenario.cpp.

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

◆ CanCompleteCriteriaTree()

bool Scenario::CanCompleteCriteriaTree ( CriteriaTree const *  tree)
overrideprotectedvirtual

Reimplemented from CriteriaHandler.

Definition at line 191 of file Scenario.cpp.

+ Here is the call graph for this function:

◆ CanUpdateCriteriaTree()

bool Scenario::CanUpdateCriteriaTree ( Criteria const *  criteria,
CriteriaTree const *  tree,
Player referencePlayer 
) const
overrideprotectedvirtual

Reimplemented from CriteriaHandler.

Definition at line 172 of file Scenario.cpp.

+ Here is the call graph for this function:

◆ CompletedCriteriaTree()

void Scenario::CompletedCriteriaTree ( CriteriaTree const *  tree,
Player referencePlayer 
)
overrideprotectedvirtual

Implements CriteriaHandler.

Definition at line 212 of file Scenario.cpp.

+ Here is the call graph for this function:

◆ CompleteScenario()

void Scenario::CompleteScenario ( )
virtual

Definition at line 88 of file Scenario.cpp.

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

◆ CompleteStep()

void Scenario::CompleteStep ( ScenarioStepEntry const *  step)
virtual

Definition at line 58 of file Scenario.cpp.

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

◆ DoForAllPlayers()

void Scenario::DoForAllPlayers ( std::function< void(Player *)> const &  worker) const
protected

Definition at line 231 of file Scenario.cpp.

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

◆ GetBonusObjectivesData()

std::vector< WorldPackets::Scenario::BonusObjectiveData > Scenario::GetBonusObjectivesData ( ) const
protected

Definition at line 314 of file Scenario.cpp.

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

◆ GetCriteriaByType()

CriteriaList const & Scenario::GetCriteriaByType ( CriteriaType  type,
uint32  asset 
) const
overrideprotectedvirtual

Implements CriteriaHandler.

Definition at line 351 of file Scenario.cpp.

◆ GetCriteriasProgressFor()

std::vector< WorldPackets::Achievement::CriteriaProgress > Scenario::GetCriteriasProgressFor ( Player const *  player) const
protected

Definition at line 334 of file Scenario.cpp.

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

◆ GetEntry()

ScenarioEntry const * Scenario::GetEntry ( ) const

Definition at line 138 of file Scenario.cpp.

+ Here is the caller graph for this function:

◆ GetFirstStep()

ScenarioStepEntry const * Scenario::GetFirstStep ( ) const

Definition at line 275 of file Scenario.cpp.

+ Here is the caller graph for this function:

◆ GetLastStep()

ScenarioStepEntry const * Scenario::GetLastStep ( ) const

Definition at line 291 of file Scenario.cpp.

+ Here is the caller graph for this function:

◆ GetStep()

ScenarioStepEntry const * Scenario::GetStep ( ) const
inline

Definition at line 73 of file Scenario.h.

+ Here is the caller graph for this function:

◆ GetStepState()

ScenarioStepState Scenario::GetStepState ( ScenarioStepEntry const *  step) const

Definition at line 143 of file Scenario.cpp.

+ Here is the caller graph for this function:

◆ IsComplete()

bool Scenario::IsComplete ( ) const

Definition at line 124 of file Scenario.cpp.

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

◆ IsCompletedStep()

bool Scenario::IsCompletedStep ( ScenarioStepEntry const *  step)

Definition at line 222 of file Scenario.cpp.

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

◆ OnPlayerEnter()

void Scenario::OnPlayerEnter ( Player player)
virtual

Definition at line 112 of file Scenario.cpp.

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

◆ OnPlayerExit()

void Scenario::OnPlayerExit ( Player player)
virtual

Definition at line 118 of file Scenario.cpp.

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

◆ Reset()

void Scenario::Reset ( )
overridevirtual

Reimplemented from CriteriaHandler.

Definition at line 52 of file Scenario.cpp.

+ Here is the call graph for this function:

◆ SendAllData()

void Scenario::SendAllData ( Player const *  ) const
inlineoverrideprotectedvirtual

Implements CriteriaHandler.

Definition at line 95 of file Scenario.h.

◆ SendBootPlayer()

void Scenario::SendBootPlayer ( Player const *  player) const

Definition at line 356 of file Scenario.cpp.

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

◆ SendCriteriaProgressRemoved()

void Scenario::SendCriteriaProgressRemoved ( uint32  )
inlineoverrideprotectedvirtual

Implements CriteriaHandler.

Definition at line 85 of file Scenario.h.

◆ SendCriteriaUpdate()

void Scenario::SendCriteriaUpdate ( Criteria const *  criteria,
CriteriaProgress const *  progress,
Seconds  timeElapsed,
bool  timedCompleted 
) const
overrideprotectedvirtual

Implements CriteriaHandler.

Definition at line 152 of file Scenario.cpp.

+ Here is the call graph for this function:

◆ SendPacket()

void Scenario::SendPacket ( WorldPacket const *  data) const
overrideprotectedvirtual

Implements CriteriaHandler.

Definition at line 238 of file Scenario.cpp.

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

◆ SendScenarioState()

void Scenario::SendScenarioState ( Player const *  player) const

Definition at line 307 of file Scenario.cpp.

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

◆ SetStep()

void Scenario::SetStep ( ScenarioStepEntry const *  step)

Definition at line 93 of file Scenario.cpp.

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

◆ SetStepState()

void Scenario::SetStepState ( ScenarioStepEntry const *  step,
ScenarioStepState  state 
)
inline

Definition at line 70 of file Scenario.h.

+ Here is the caller graph for this function:

◆ Update()

virtual void Scenario::Update ( uint32  )
inlinevirtual

Definition at line 66 of file Scenario.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _currentstep

ScenarioStepEntry const* Scenario::_currentstep
private

Definition at line 107 of file Scenario.h.

◆ _data

ScenarioData const* Scenario::_data
protected

Definition at line 103 of file Scenario.h.

◆ _guid

ObjectGuid const Scenario::_guid
private

Definition at line 106 of file Scenario.h.

◆ _map

Map const* Scenario::_map
protected

Definition at line 81 of file Scenario.h.

◆ _players

GuidUnorderedSet Scenario::_players
protected

Definition at line 82 of file Scenario.h.

◆ _stepStates

std::map<ScenarioStepEntry const*, ScenarioStepState> Scenario::_stepStates
private

Definition at line 108 of file Scenario.h.


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