TrinityCore
Loading...
Searching...
No Matches
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.

References DEFAULT_LOCALE.

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

◆ GetGreeting()

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

Definition at line 221 of file Trainer.cpp.

References DEFAULT_LOCALE.

◆ GetSpell()

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

Definition at line 136 of file Trainer.cpp.

◆ GetSpellState()

◆ SendSpells()

◆ SendTeachFailure()

◆ TeachSpell()

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: