TrinityCore
Loading...
Searching...
No Matches
ReputationMgr Class Reference

#include <ReputationMgr.h>

Public Member Functions

 ReputationMgr (Player *owner)
 
 ~ReputationMgr ()
 
void SaveToDB (CharacterDatabaseTransaction trans)
 
void LoadFromDB (PreparedQueryResult result)
 
uint8 GetVisibleFactionCount () const
 
uint8 GetHonoredFactionCount () const
 
uint8 GetReveredFactionCount () const
 
uint8 GetExaltedFactionCount () const
 
FactionStateList const & GetStateList () const
 
FactionState const * GetState (FactionEntry const *factionEntry) const
 
FactionState const * GetState (RepListID id) const
 
bool IsAtWar (uint32 faction_id) const
 
bool IsAtWar (FactionEntry const *factionEntry) const
 
bool IsReputationAllowedForTeam (TeamId team, uint32 factionId) const
 
int32 GetReputation (uint32 faction_id) const
 
int32 GetReputation (FactionEntry const *factionEntry) const
 
int32 GetBaseReputation (FactionEntry const *factionEntry) const
 
int32 GetMinReputation (FactionEntry const *factionEntry) const
 
int32 GetMaxReputation (FactionEntry const *factionEntry) const
 
ReputationRank GetRank (FactionEntry const *factionEntry) const
 
ReputationRank GetBaseRank (FactionEntry const *factionEntry) const
 
std::string GetReputationRankName (FactionEntry const *factionEntry) const
 
ReputationRank const * GetForcedRankIfAny (FactionTemplateEntry const *factionTemplateEntry) const
 
ReputationRank const * GetForcedRankIfAny (uint32 factionId) const
 
bool SetReputation (FactionEntry const *factionEntry, int32 standing)
 
bool ModifyReputation (FactionEntry const *factionEntry, int32 standing, bool spillOverOnly=false)
 
void SetVisible (FactionTemplateEntry const *factionTemplateEntry)
 
void SetVisible (FactionEntry const *factionEntry)
 
void SetAtWar (RepListID repListID, bool on)
 
void SetInactive (RepListID repListID, bool on)
 
void ApplyForceReaction (uint32 faction_id, ReputationRank rank, bool apply)
 
bool SetOneFactionReputation (FactionEntry const *factionEntry, int32 standing, bool incremental)
 Public for chat command needs.
 
void SendInitialReputations ()
 
void SendForceReactions ()
 
void SendState (FactionState const *faction)
 

Static Public Member Functions

static ReputationRank ReputationToRank (FactionEntry const *factionEntry, int32 standing)
 

Static Public Attributes

static std::set< int32 > const ReputationRankThresholds
 
static const int32 Reputation_Cap = 42999
 
static const int32 Reputation_Bottom = -42000
 

Private Member Functions

void Initialize ()
 
ReputationFlags GetDefaultStateFlags (FactionEntry const *factionEntry) const
 
bool SetReputation (FactionEntry const *factionEntry, int32 standing, bool incremental, bool spillOverOnly)
 
void SetVisible (FactionState *faction)
 
void SetAtWar (FactionState *faction, bool atWar) const
 
void SetInactive (FactionState *faction, bool inactive) const
 
void SendVisible (FactionState const *faction) const
 
void UpdateRankCounters (ReputationRank old_rank, ReputationRank new_rank)
 
int32 GetFactionDataIndexForRaceAndClass (FactionEntry const *factionEntry) const
 

Private Attributes

Player_player
 
FactionStateList _factions
 
ForcedReactions _forcedReactions
 
uint8 _visibleFactionCount
 
uint8 _honoredFactionCount
 
uint8 _reveredFactionCount
 
uint8 _exaltedFactionCount
 
bool _sendFactionIncreased
 

Detailed Description

Definition at line 63 of file ReputationMgr.h.

Constructor & Destructor Documentation

◆ ReputationMgr()

ReputationMgr::ReputationMgr ( Player owner)
inlineexplicit

Definition at line 66 of file ReputationMgr.h.

◆ ~ReputationMgr()

ReputationMgr::~ReputationMgr ( )
inline

Definition at line 68 of file ReputationMgr.h.

Member Function Documentation

◆ ApplyForceReaction()

void ReputationMgr::ApplyForceReaction ( uint32  faction_id,
ReputationRank  rank,
bool  apply 
)

Definition at line 189 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

◆ GetBaseRank()

ReputationRank ReputationMgr::GetBaseRank ( FactionEntry const *  factionEntry) const

Definition at line 167 of file ReputationMgr.cpp.

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

◆ GetBaseReputation()

int32 ReputationMgr::GetBaseReputation ( FactionEntry const *  factionEntry) const

Definition at line 130 of file ReputationMgr.cpp.

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

◆ GetDefaultStateFlags()

ReputationFlags ReputationMgr::GetDefaultStateFlags ( FactionEntry const *  factionEntry) const
private

Definition at line 197 of file ReputationMgr.cpp.

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

◆ GetExaltedFactionCount()

uint8 ReputationMgr::GetExaltedFactionCount ( ) const
inline

Definition at line 82 of file ReputationMgr.h.

◆ GetFactionDataIndexForRaceAndClass()

int32 ReputationMgr::GetFactionDataIndexForRaceAndClass ( FactionEntry const *  factionEntry) const
private

Definition at line 664 of file ReputationMgr.cpp.

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

◆ GetForcedRankIfAny() [1/2]

ReputationRank const * ReputationMgr::GetForcedRankIfAny ( FactionTemplateEntry const *  factionTemplateEntry) const

Definition at line 179 of file ReputationMgr.cpp.

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

◆ GetForcedRankIfAny() [2/2]

ReputationRank const * ReputationMgr::GetForcedRankIfAny ( uint32  factionId) const

Definition at line 184 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ GetHonoredFactionCount()

uint8 ReputationMgr::GetHonoredFactionCount ( ) const
inline

Definition at line 80 of file ReputationMgr.h.

◆ GetMaxReputation()

int32 ReputationMgr::GetMaxReputation ( FactionEntry const *  factionEntry) const

Definition at line 144 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

◆ GetMinReputation()

int32 ReputationMgr::GetMinReputation ( FactionEntry const *  factionEntry) const

Definition at line 139 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

◆ GetRank()

ReputationRank ReputationMgr::GetRank ( FactionEntry const *  factionEntry) const

Definition at line 161 of file ReputationMgr.cpp.

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

◆ GetReputation() [1/2]

int32 ReputationMgr::GetReputation ( FactionEntry const *  factionEntry) const

Definition at line 149 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ GetReputation() [2/2]

int32 ReputationMgr::GetReputation ( uint32  faction_id) const

Definition at line 117 of file ReputationMgr.cpp.

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

◆ GetReputationRankName()

std::string ReputationMgr::GetReputationRankName ( FactionEntry const *  factionEntry) const

Definition at line 173 of file ReputationMgr.cpp.

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

◆ GetReveredFactionCount()

uint8 ReputationMgr::GetReveredFactionCount ( ) const
inline

Definition at line 81 of file ReputationMgr.h.

◆ GetState() [1/2]

FactionState const * ReputationMgr::GetState ( FactionEntry const *  factionEntry) const

Definition at line 74 of file ReputationMgr.cpp.

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

◆ GetState() [2/2]

FactionState const * ReputationMgr::GetState ( RepListID  id) const
inline

Definition at line 88 of file ReputationMgr.h.

◆ GetStateList()

FactionStateList const & ReputationMgr::GetStateList ( ) const
inline

Definition at line 84 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ GetVisibleFactionCount()

uint8 ReputationMgr::GetVisibleFactionCount ( ) const
inline

Definition at line 79 of file ReputationMgr.h.

◆ Initialize()

void ReputationMgr::Initialize ( )
private

Definition at line 302 of file ReputationMgr.cpp.

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

◆ IsAtWar() [1/2]

bool ReputationMgr::IsAtWar ( FactionEntry const *  factionEntry) const

Definition at line 92 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ IsAtWar() [2/2]

bool ReputationMgr::IsAtWar ( uint32  faction_id) const

Definition at line 79 of file ReputationMgr.cpp.

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

◆ IsReputationAllowedForTeam()

bool ReputationMgr::IsReputationAllowedForTeam ( TeamId  team,
uint32  factionId 
) const

Definition at line 102 of file ReputationMgr.cpp.

◆ LoadFromDB()

void ReputationMgr::LoadFromDB ( PreparedQueryResult  result)

Definition at line 564 of file ReputationMgr.cpp.

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

◆ ModifyReputation()

bool ReputationMgr::ModifyReputation ( FactionEntry const *  factionEntry,
int32  standing,
bool  spillOverOnly = false 
)
inline

Definition at line 116 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ ReputationToRank()

ReputationRank ReputationMgr::ReputationToRank ( FactionEntry const *  factionEntry,
int32  standing 
)
static

Definition at line 60 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

◆ SaveToDB()

void ReputationMgr::SaveToDB ( CharacterDatabaseTransaction  trans)

Definition at line 624 of file ReputationMgr.cpp.

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

◆ SendForceReactions()

void ReputationMgr::SendForceReactions ( )

Definition at line 206 of file ReputationMgr.cpp.

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

◆ SendInitialReputations()

void ReputationMgr::SendInitialReputations ( )

Definition at line 255 of file ReputationMgr.cpp.

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

◆ SendState()

void ReputationMgr::SendState ( FactionState const *  faction)

Definition at line 219 of file ReputationMgr.cpp.

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

◆ SendVisible()

void ReputationMgr::SendVisible ( FactionState const *  faction) const
private

Definition at line 291 of file ReputationMgr.cpp.

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

◆ SetAtWar() [1/2]

void ReputationMgr::SetAtWar ( FactionState faction,
bool  atWar 
) const
private

Definition at line 517 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetAtWar() [2/2]

void ReputationMgr::SetAtWar ( RepListID  repListID,
bool  on 
)

Definition at line 504 of file ReputationMgr.cpp.

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

◆ SetInactive() [1/2]

void ReputationMgr::SetInactive ( FactionState faction,
bool  inactive 
) const
private

Definition at line 545 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetInactive() [2/2]

void ReputationMgr::SetInactive ( RepListID  repListID,
bool  on 
)

Definition at line 536 of file ReputationMgr.cpp.

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

◆ SetOneFactionReputation()

bool ReputationMgr::SetOneFactionReputation ( FactionEntry const *  factionEntry,
int32  standing,
bool  incremental 
)

Public for chat command needs.

Definition at line 409 of file ReputationMgr.cpp.

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

◆ SetReputation() [1/2]

bool ReputationMgr::SetReputation ( FactionEntry const *  factionEntry,
int32  standing 
)
inline

Definition at line 112 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ SetReputation() [2/2]

bool ReputationMgr::SetReputation ( FactionEntry const *  factionEntry,
int32  standing,
bool  incremental,
bool  spillOverOnly 
)
private

Definition at line 335 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetVisible() [1/3]

void ReputationMgr::SetVisible ( FactionEntry const *  factionEntry)

Definition at line 470 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetVisible() [2/3]

void ReputationMgr::SetVisible ( FactionState faction)
private

Definition at line 482 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetVisible() [3/3]

void ReputationMgr::SetVisible ( FactionTemplateEntry const *  factionTemplateEntry)

Definition at line 459 of file ReputationMgr.cpp.

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

◆ UpdateRankCounters()

void ReputationMgr::UpdateRankCounters ( ReputationRank  old_rank,
ReputationRank  new_rank 
)
private

Definition at line 647 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _exaltedFactionCount

uint8 ReputationMgr::_exaltedFactionCount
private

Definition at line 154 of file ReputationMgr.h.

◆ _factions

FactionStateList ReputationMgr::_factions
private

Definition at line 149 of file ReputationMgr.h.

◆ _forcedReactions

ForcedReactions ReputationMgr::_forcedReactions
private

Definition at line 150 of file ReputationMgr.h.

◆ _honoredFactionCount

uint8 ReputationMgr::_honoredFactionCount
private

Definition at line 152 of file ReputationMgr.h.

◆ _player

Player* ReputationMgr::_player
private

Definition at line 148 of file ReputationMgr.h.

◆ _reveredFactionCount

uint8 ReputationMgr::_reveredFactionCount
private

Definition at line 153 of file ReputationMgr.h.

◆ _sendFactionIncreased

bool ReputationMgr::_sendFactionIncreased
private

Definition at line 155 of file ReputationMgr.h.

◆ _visibleFactionCount

uint8 ReputationMgr::_visibleFactionCount
private

Definition at line 151 of file ReputationMgr.h.

◆ Reputation_Bottom

const int32 ReputationMgr::Reputation_Bottom = -42000
static

Definition at line 75 of file ReputationMgr.h.

◆ Reputation_Cap

const int32 ReputationMgr::Reputation_Cap = 42999
static

Definition at line 74 of file ReputationMgr.h.

◆ ReputationRankThresholds

std::set< int32 > const ReputationMgr::ReputationRankThresholds
static
Initial value:
=
{
-42000,
-6000,
-3000,
0,
3000,
9000,
21000,
42000,
43000
}

Definition at line 36 of file ReputationMgr.h.


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