TrinityCore
Trainer::Trainer Class Reference

#include <Trainer.h>

Public Member Functions

 Trainer (uint32 id, Type type, std::string_view greeting, std::vector< Spell > spells)
 
void SendSpells (Creature const *npc, Player *player, LocaleConstant locale) const
 
void TeachSpell (Creature const *npc, Player *player, uint32 spellId) const
 

Private Member Functions

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

Private Attributes

friend ObjectMgr
 
uint32 _id
 
Type _type
 
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  id,
Type  type,
std::string_view  greeting,
std::vector< Spell spells 
)

Definition at line 36 of file Trainer.cpp.

Member Function Documentation

◆ AddGreetingLocale()

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

Definition at line 229 of file Trainer.cpp.

◆ CanTeachSpell()

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

Definition at line 149 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 221 of file Trainer.cpp.

◆ GetSpell()

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

Definition at line 136 of file Trainer.cpp.

◆ GetSpellState()

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

Definition at line 172 of file Trainer.cpp.

+ Here is the call graph for this function:

◆ SendSpells()

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

Definition at line 41 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 212 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 76 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 86 of file Trainer.h.

◆ _id

uint32 Trainer::Trainer::_id
private

Definition at line 83 of file Trainer.h.

◆ _spells

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

Definition at line 85 of file Trainer.h.

◆ _type

Type Trainer::Trainer::_type
private

Definition at line 84 of file Trainer.h.

◆ ObjectMgr

friend Trainer::Trainer::ObjectMgr
private

Definition at line 80 of file Trainer.h.


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