TrinityCore
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 SendInfo ()
 
void SendRemoteInfo () const
 
void SendBlueprintAndSpecializationData ()
 
void SendMapData (Player *receiver) const
 
void ResetFollowerActivationLimit ()
 

Static Public Member Functions

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

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 183 of file Garrison.h.

Constructor & Destructor Documentation

◆ Garrison()

Garrison::Garrison ( Player owner)
explicit

Definition at line 33 of file Garrison.cpp.

Member Function Documentation

◆ ActivateBuilding()

void Garrison::ActivateBuilding ( uint32  garrPlotInstanceId)

Definition at line 479 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ AddFollower()

void Garrison::AddFollower ( uint32  garrFollowerId)

Definition at line 502 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ CancelBuildingConstruction()

void Garrison::CancelBuildingConstruction ( uint32  garrPlotInstanceId)

Definition at line 429 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 616 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 669 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 252 of file Garrison.h.

+ Here is the caller graph for this function:

◆ Create()

bool Garrison::Create ( uint32  garrSiteId)

Definition at line 226 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ Delete()

void Garrison::Delete ( )

Definition at line 244 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 207 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 287 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 611 of file Garrison.cpp.

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

◆ GetFaction()

GarrisonFactionIndex Garrison::GetFaction ( ) const

Definition at line 313 of file Garrison.cpp.

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

◆ GetFollower()

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

Definition at line 535 of file Garrison.cpp.

+ Here is the caller graph for this function:

◆ GetPlot() [1/2]

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

Definition at line 328 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 337 of file Garrison.cpp.

◆ GetPlots()

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

Definition at line 318 of file Garrison.cpp.

+ Here is the caller graph for this function:

◆ GetSiteLevel()

GarrSiteLevelEntry const * Garrison::GetSiteLevel ( ) const
inline

Definition at line 233 of file Garrison.h.

+ Here is the caller graph for this function:

◆ GetType()

GarrisonType Garrison::GetType ( ) const
inline

Definition at line 232 of file Garrison.h.

+ Here is the caller graph for this function:

◆ HasBlueprint()

bool Garrison::HasBlueprint ( uint32  garrBuildingId) const
inline

Definition at line 243 of file Garrison.h.

+ Here is the caller graph for this function:

◆ InitializePlots()

void Garrison::InitializePlots ( )
private

Definition at line 256 of file Garrison.cpp.

+ Here is the caller graph for this function:

◆ LearnBlueprint()

void Garrison::LearnBlueprint ( uint32  garrBuildingId)

Definition at line 346 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ Leave()

void Garrison::Leave ( ) const

Definition at line 300 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 37 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ PlaceBuilding()

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

Definition at line 380 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ ResetFollowerActivationLimit()

void Garrison::ResetFollowerActivationLimit ( )
inline

Definition at line 267 of file Garrison.h.

◆ SaveToDB()

void Garrison::SaveToDB ( CharacterDatabaseTransaction  trans)

Definition at line 144 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ SendBlueprintAndSpecializationData()

void Garrison::SendBlueprintAndSpecializationData ( )

Definition at line 587 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ SendInfo()

void Garrison::SendInfo ( )

Definition at line 544 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ SendMapData()

void Garrison::SendMapData ( Player receiver) const

Definition at line 595 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ SendRemoteInfo()

void Garrison::SendRemoteInfo ( ) const

Definition at line 569 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 363 of file Garrison.cpp.

+ Here is the call graph for this function:

◆ Upgrade()

void Garrison::Upgrade ( )

Definition at line 283 of file Garrison.cpp.

Member Data Documentation

◆ _followerActivationsRemainingToday

uint32 Garrison::_followerActivationsRemainingToday
private

Definition at line 276 of file Garrison.h.

◆ _followerIds

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

Definition at line 281 of file Garrison.h.

◆ _followers

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

Definition at line 280 of file Garrison.h.

◆ _knownBuildings

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

Definition at line 279 of file Garrison.h.

◆ _owner

Player* Garrison::_owner
private

Definition at line 274 of file Garrison.h.

◆ _plots

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

Definition at line 278 of file Garrison.h.

◆ _siteLevel

GarrSiteLevelEntry const* Garrison::_siteLevel
private

Definition at line 275 of file Garrison.h.


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