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

#include <Garrison.h>

Classes

struct  Building
 
struct  Follower
 
struct  Plot
 

Public Member Functions

 Garrison (Player *owner)
 
bool LoadFromDB (PreparedQueryResult garrison, PreparedQueryResult blueprints, PreparedQueryResult buildings, PreparedQueryResult followers, PreparedQueryResult abilities)
 
void SaveToDB (CharacterDatabaseTransaction trans)
 
bool Create (uint32 garrSiteId)
 
void Delete ()
 
void Upgrade ()
 
void Enter () const
 
void Leave () const
 
GarrisonFactionIndex GetFaction () const
 
GarrisonType GetType () const
 
GarrSiteLevelEntry const * GetSiteLevel () const
 
std::vector< Plot * > GetPlots ()
 
PlotGetPlot (uint32 garrPlotInstanceId)
 
Plot const * GetPlot (uint32 garrPlotInstanceId) const
 
void LearnBlueprint (uint32 garrBuildingId)
 
void UnlearnBlueprint (uint32 garrBuildingId)
 
bool HasBlueprint (uint32 garrBuildingId) const
 
void PlaceBuilding (uint32 garrPlotInstanceId, uint32 garrBuildingId)
 
void CancelBuildingConstruction (uint32 garrPlotInstanceId)
 
void ActivateBuilding (uint32 garrPlotInstanceId)
 
void AddFollower (uint32 garrFollowerId)
 
Follower const * GetFollower (uint64 dbId) const
 
template<typename Predicate >
uint32 CountFollowers (Predicate &&predicate) const
 
void BuildInfoPacket (WorldPackets::Garrison::GarrisonInfo &garrison) const
 
void SendRemoteInfo () const
 
void SendBlueprintAndSpecializationData ()
 
void SendMapData (Player *receiver) const
 
void ResetFollowerActivationLimit ()
 

Static Public Member Functions

static void DeleteFromDB (ObjectGuid::LowType ownerGuid, CharacterDatabaseTransaction trans)
 
static constexpr GarrisonFactionIndex GetFaction (Team team)
 

Private Member Functions

MapFindMap () const
 
void InitializePlots ()
 
GarrisonError CheckBuildingPlacement (uint32 garrPlotInstanceId, uint32 garrBuildingId) const
 
GarrisonError CheckBuildingRemoval (uint32 garrPlotInstanceId) const
 

Private Attributes

Player_owner
 
GarrSiteLevelEntry const * _siteLevel
 
uint32 _followerActivationsRemainingToday
 
std::unordered_map< uint32, Plot_plots
 
std::unordered_set< uint32_knownBuildings
 
std::unordered_map< uint64, Follower_followers
 
std::unordered_set< uint32_followerIds
 

Detailed Description

Definition at line 184 of file Garrison.h.

Constructor & Destructor Documentation

◆ Garrison()

Garrison::Garrison ( Player owner)
explicit

Definition at line 34 of file Garrison.cpp.

Member Function Documentation

◆ ActivateBuilding()

void Garrison::ActivateBuilding ( uint32  garrPlotInstanceId)

Definition at line 468 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ AddFollower()

void Garrison::AddFollower ( uint32  garrFollowerId)

Definition at line 491 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ BuildInfoPacket()

void Garrison::BuildInfoPacket ( WorldPackets::Garrison::GarrisonInfo garrison) const

Definition at line 533 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ CancelBuildingConstruction()

void Garrison::CancelBuildingConstruction ( uint32  garrPlotInstanceId)

Definition at line 418 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ CheckBuildingPlacement()

GarrisonError Garrison::CheckBuildingPlacement ( uint32  garrPlotInstanceId,
uint32  garrBuildingId 
) const
private

Definition at line 598 of file Garrison.cpp.

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

◆ CheckBuildingRemoval()

GarrisonError Garrison::CheckBuildingRemoval ( uint32  garrPlotInstanceId) const
private

Definition at line 651 of file Garrison.cpp.

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

◆ CountFollowers()

template<typename Predicate >
uint32 Garrison::CountFollowers ( Predicate &&  predicate) const
inline

Definition at line 254 of file Garrison.h.

+ Here is the caller graph for this function:

◆ Create()

bool Garrison::Create ( uint32  garrSiteId)

Definition at line 227 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ Delete()

void Garrison::Delete ( )

Definition at line 245 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ DeleteFromDB()

void Garrison::DeleteFromDB ( ObjectGuid::LowType  ownerGuid,
CharacterDatabaseTransaction  trans 
)
static

Definition at line 208 of file Garrison.cpp.

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

◆ Enter()

void Garrison::Enter ( ) const

Definition at line 288 of file Garrison.cpp.

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

◆ FindMap()

Map * Garrison::FindMap ( ) const
private

Definition at line 593 of file Garrison.cpp.

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

◆ GetFaction() [1/2]

GarrisonFactionIndex Garrison::GetFaction ( ) const

Definition at line 302 of file Garrison.cpp.

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

◆ GetFaction() [2/2]

static constexpr GarrisonFactionIndex Garrison::GetFaction ( Team  team)
inlinestaticconstexpr

Definition at line 232 of file Garrison.h.

+ Here is the caller graph for this function:

◆ GetFollower()

Garrison::Follower const * Garrison::GetFollower ( uint64  dbId) const

Definition at line 524 of file Garrison.cpp.

+ Here is the caller graph for this function:

◆ GetPlot() [1/2]

Garrison::Plot * Garrison::GetPlot ( uint32  garrPlotInstanceId)

Definition at line 317 of file Garrison.cpp.

+ Here is the caller graph for this function:

◆ GetPlot() [2/2]

Garrison::Plot const * Garrison::GetPlot ( uint32  garrPlotInstanceId) const

Definition at line 326 of file Garrison.cpp.

◆ GetPlots()

std::vector< Garrison::Plot * > Garrison::GetPlots ( )

Definition at line 307 of file Garrison.cpp.

+ Here is the caller graph for this function:

◆ GetSiteLevel()

GarrSiteLevelEntry const * Garrison::GetSiteLevel ( ) const
inline

Definition at line 235 of file Garrison.h.

+ Here is the caller graph for this function:

◆ GetType()

GarrisonType Garrison::GetType ( ) const
inline

Definition at line 234 of file Garrison.h.

+ Here is the caller graph for this function:

◆ HasBlueprint()

bool Garrison::HasBlueprint ( uint32  garrBuildingId) const
inline

Definition at line 245 of file Garrison.h.

+ Here is the caller graph for this function:

◆ InitializePlots()

void Garrison::InitializePlots ( )
private

Definition at line 257 of file Garrison.cpp.

+ Here is the caller graph for this function:

◆ LearnBlueprint()

void Garrison::LearnBlueprint ( uint32  garrBuildingId)

Definition at line 335 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ Leave()

void Garrison::Leave ( ) const

Definition at line 295 of file Garrison.cpp.

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

◆ LoadFromDB()

bool Garrison::LoadFromDB ( PreparedQueryResult  garrison,
PreparedQueryResult  blueprints,
PreparedQueryResult  buildings,
PreparedQueryResult  followers,
PreparedQueryResult  abilities 
)

Definition at line 38 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ PlaceBuilding()

void Garrison::PlaceBuilding ( uint32  garrPlotInstanceId,
uint32  garrBuildingId 
)

Definition at line 369 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ ResetFollowerActivationLimit()

void Garrison::ResetFollowerActivationLimit ( )
inline

Definition at line 269 of file Garrison.h.

◆ SaveToDB()

void Garrison::SaveToDB ( CharacterDatabaseTransaction  trans)

Definition at line 145 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ SendBlueprintAndSpecializationData()

void Garrison::SendBlueprintAndSpecializationData ( )

Definition at line 569 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ SendMapData()

void Garrison::SendMapData ( Player receiver) const

Definition at line 577 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ SendRemoteInfo()

void Garrison::SendRemoteInfo ( ) const

Definition at line 551 of file Garrison.cpp.

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

◆ UnlearnBlueprint()

void Garrison::UnlearnBlueprint ( uint32  garrBuildingId)

Definition at line 352 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ Upgrade()

void Garrison::Upgrade ( )

Definition at line 284 of file Garrison.cpp.

Member Data Documentation

◆ _followerActivationsRemainingToday

uint32 Garrison::_followerActivationsRemainingToday
private

Definition at line 278 of file Garrison.h.

◆ _followerIds

std::unordered_set<uint32> Garrison::_followerIds
private

Definition at line 283 of file Garrison.h.

◆ _followers

std::unordered_map<uint64 , Follower> Garrison::_followers
private

Definition at line 282 of file Garrison.h.

◆ _knownBuildings

std::unordered_set<uint32 > Garrison::_knownBuildings
private

Definition at line 281 of file Garrison.h.

◆ _owner

Player* Garrison::_owner
private

Definition at line 276 of file Garrison.h.

◆ _plots

std::unordered_map<uint32 , Plot> Garrison::_plots
private

Definition at line 280 of file Garrison.h.

◆ _siteLevel

GarrSiteLevelEntry const* Garrison::_siteLevel
private

Definition at line 277 of file Garrison.h.


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