TrinityCore
Loading...
Searching...
No Matches
Trainer::Trainer Class Reference

#include <Trainer.h>

Public Member Functions

 Trainer (uint32 trainerId, Type type, uint32 requirement, std::string greeting, std::vector< Spell > spells)
 
Spell const * GetSpell (uint32 spellId) const
 
std::vector< Spell > const & GetSpells () const
 
void SendSpells (Creature const *npc, Player const *player, LocaleConstant locale) const
 
bool CanTeachSpell (Player const *player, Spell const *trainerSpell) const
 
void TeachSpell (Creature const *npc, Player *player, uint32 spellId) const
 
Type GetTrainerType () const
 
uint32 GetTrainerRequirement () const
 
bool IsTrainerValidForPlayer (Player const *player) const
 

Private Member Functions

SpellState GetSpellState (Player const *player, Spell const *trainerSpell) const
 
void SendTeachFailure (Creature const *npc, Player const *player, uint32 spellId, FailReason reason) const
 
void SendTeachSucceeded (Creature const *npc, Player const *player, uint32 spellId) const
 
std::string const & GetGreeting (LocaleConstant locale) const
 
void AddGreetingLocale (LocaleConstant locale, std::string greeting)
 

Private Attributes

friend ObjectMgr
 
uint32 _trainerId
 
Type _type
 
uint32 _requirement
 
std::vector< Spell_spells
 
std::array< std::string, TOTAL_LOCALES_greeting
 

Detailed Description

Definition at line 65 of file Trainer.h.

Constructor & Destructor Documentation

◆ Trainer()

Trainer::Trainer::Trainer ( uint32  trainerId,
Type  type,
uint32  requirement,
std::string  greeting,
std::vector< Spell spells 
)

Definition at line 32 of file Trainer.cpp.

Member Function Documentation

◆ AddGreetingLocale()

void Trainer::Trainer::AddGreetingLocale ( LocaleConstant  locale,
std::string  greeting 
)
private

Definition at line 258 of file Trainer.cpp.

◆ CanTeachSpell()

bool Trainer::Trainer::CanTeachSpell ( Player const *  player,
Spell const *  trainerSpell 
) const

Definition at line 133 of file Trainer.cpp.

+ Here is the call graph for this function:

◆ GetGreeting()

std::string const & Trainer::Trainer::GetGreeting ( LocaleConstant  locale) const
private

Definition at line 250 of file Trainer.cpp.

◆ GetSpell()

Spell const * Trainer::Trainer::GetSpell ( uint32  spellId) const

Definition at line 120 of file Trainer.cpp.

◆ GetSpells()

std::vector< Spell > const & Trainer::Trainer::GetSpells ( ) const
inline

Definition at line 71 of file Trainer.h.

◆ GetSpellState()

SpellState Trainer::Trainer::GetSpellState ( Player const *  player,
Spell const *  trainerSpell 
) const
private

Definition at line 154 of file Trainer.cpp.

+ Here is the call graph for this function:

◆ GetTrainerRequirement()

uint32 Trainer::Trainer::GetTrainerRequirement ( ) const
inline

Definition at line 77 of file Trainer.h.

◆ GetTrainerType()

Type Trainer::Trainer::GetTrainerType ( ) const
inline

Definition at line 76 of file Trainer.h.

+ Here is the caller graph for this function:

◆ IsTrainerValidForPlayer()

bool Trainer::Trainer::IsTrainerValidForPlayer ( Player const *  player) const

Definition at line 209 of file Trainer.cpp.

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

◆ SendSpells()

void Trainer::Trainer::SendSpells ( Creature const *  npc,
Player const *  player,
LocaleConstant  locale 
) const

Definition at line 37 of file Trainer.cpp.

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

◆ SendTeachFailure()

void Trainer::Trainer::SendTeachFailure ( Creature const *  npc,
Player const *  player,
uint32  spellId,
FailReason  reason 
) const
private

Definition at line 233 of file Trainer.cpp.

+ Here is the call graph for this function:

◆ SendTeachSucceeded()

void Trainer::Trainer::SendTeachSucceeded ( Creature const *  npc,
Player const *  player,
uint32  spellId 
) const
private

Definition at line 242 of file Trainer.cpp.

+ Here is the call graph for this function:

◆ TeachSpell()

void Trainer::Trainer::TeachSpell ( Creature const *  npc,
Player player,
uint32  spellId 
) const

Definition at line 80 of file Trainer.cpp.

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

Member Data Documentation

◆ _greeting

std::array<std::string, TOTAL_LOCALES> Trainer::Trainer::_greeting
private

Definition at line 93 of file Trainer.h.

◆ _requirement

uint32 Trainer::Trainer::_requirement
private

Definition at line 91 of file Trainer.h.

◆ _spells

std::vector<Spell> Trainer::Trainer::_spells
private

Definition at line 92 of file Trainer.h.

◆ _trainerId

uint32 Trainer::Trainer::_trainerId
private

Definition at line 89 of file Trainer.h.

◆ _type

Type Trainer::Trainer::_type
private

Definition at line 90 of file Trainer.h.

◆ ObjectMgr

friend Trainer::Trainer::ObjectMgr
private

Definition at line 86 of file Trainer.h.


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