TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPackets::Garrison::GetGarrisonInfoResult Class Referencefinal

#include <GarrisonPackets.h>

Public Member Functions

 GetGarrisonInfoResult ()
 
WorldPacket constWrite () override
 
- Public Member Functions inherited from WorldPackets::ServerPacket
 ServerPacket (OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
void Read () overridefinal
 
void Clear ()
 
WorldPacket && Move ()
 
OpcodeServer GetOpcode () const
 
- Public Member Functions inherited from WorldPackets::Packet
 Packet (WorldPacket &&worldPacket)
 
virtual ~Packet ()=default
 
 Packet (Packet const &right)=delete
 
Packetoperator= (Packet const &right)=delete
 
WorldPacket constGetRawPacket () const
 
size_t GetSize () const
 
ConnectionType GetConnection () const
 

Public Attributes

uint32 GarrSiteID = 0
 
uint32 GarrSiteLevelID = 0
 
uint32 FactionIndex = 0
 
uint32 NumFollowerActivationsRemaining = 0
 
std::vector< GarrisonPlotInfo * > Plots
 
std::vector
< GarrisonBuildingInfo const * > 
Buildings
 
std::vector< GarrisonFollower
const * > 
Followers
 
std::vector< GarrisonMission
const * > 
Missions
 
std::vector
< GarrisonMissionAreaBonus
const * > 
MissionAreaBonuses
 
std::vector< boolCanStartMission
 
std::vector< int32ArchivedMissions
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Garrison::GetGarrisonInfoResult::GetGarrisonInfoResult ( )
inline
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:1047

Member Function Documentation

WorldPacket const * WorldPackets::Garrison::GetGarrisonInfoResult::Write ( )
overridevirtual

Implements WorldPackets::Packet.

104 {
105  _worldPacket.reserve(4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 +
106  Buildings.size() * sizeof(GarrisonBuildingInfo) +
107  Plots.size() * sizeof(GarrisonPlotInfo) +
108  Followers.size() * (sizeof(GarrisonFollower) + 5 * 4) +
109  Missions.size() * sizeof(GarrisonMission) +
110  MissionAreaBonuses.size() * sizeof(GarrisonMissionAreaBonus) +
111  ArchivedMissions.size() * 4 +
112  CanStartMission.size());
113 
117  _worldPacket << uint32(Buildings.size());
118  _worldPacket << uint32(Plots.size());
119  _worldPacket << uint32(Followers.size());
120  _worldPacket << uint32(Missions.size());
125 
126  for (GarrisonBuildingInfo const* building : Buildings)
127  _worldPacket << *building;
128 
129  for (GarrisonPlotInfo* plot : Plots)
130  _worldPacket << *plot;
131 
132  for (GarrisonFollower const* follower : Followers)
133  _worldPacket << *follower;
134 
135  for (GarrisonMission const* mission : Missions)
136  _worldPacket << *mission;
137 
138  for (GarrisonMissionAreaBonus const* areaBonus : MissionAreaBonuses)
139  _worldPacket << *areaBonus;
140 
141  if (!ArchivedMissions.empty())
143 
144  for (bool canStartMission : CanStartMission)
145  _worldPacket.WriteBit(canStartMission);
146 
148 
149  return &_worldPacket;
150 }
std::vector< bool > CanStartMission
Definition: GarrisonPackets.h:128
uint32 NumFollowerActivationsRemaining
Definition: GarrisonPackets.h:122
uint32 FactionIndex
Definition: GarrisonPackets.h:121
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
std::vector< GarrisonPlotInfo * > Plots
Definition: GarrisonPackets.h:123
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
uint32 GarrSiteID
Definition: GarrisonPackets.h:119
uint32 GarrSiteLevelID
Definition: GarrisonPackets.h:120
std::vector< int32 > ArchivedMissions
Definition: GarrisonPackets.h:129
void reserve(size_t ressize)
Definition: ByteBuffer.h:597
void append(T value)
Definition: ByteBuffer.h:143
std::vector< GarrisonFollower const * > Followers
Definition: GarrisonPackets.h:125
std::vector< GarrisonMissionAreaBonus const * > MissionAreaBonuses
Definition: GarrisonPackets.h:127
int32_t int32
Definition: g3dmath.h:167
uint32_t uint32
Definition: g3dmath.h:168
std::vector< GarrisonMission const * > Missions
Definition: GarrisonPackets.h:126
std::vector< GarrisonBuildingInfo const * > Buildings
Definition: GarrisonPackets.h:124

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<int32> WorldPackets::Garrison::GetGarrisonInfoResult::ArchivedMissions
std::vector<GarrisonBuildingInfo const*> WorldPackets::Garrison::GetGarrisonInfoResult::Buildings
std::vector<bool> WorldPackets::Garrison::GetGarrisonInfoResult::CanStartMission
uint32 WorldPackets::Garrison::GetGarrisonInfoResult::FactionIndex = 0
std::vector<GarrisonFollower const*> WorldPackets::Garrison::GetGarrisonInfoResult::Followers
uint32 WorldPackets::Garrison::GetGarrisonInfoResult::GarrSiteID = 0
uint32 WorldPackets::Garrison::GetGarrisonInfoResult::GarrSiteLevelID = 0
std::vector<GarrisonMissionAreaBonus const*> WorldPackets::Garrison::GetGarrisonInfoResult::MissionAreaBonuses
std::vector<GarrisonMission const*> WorldPackets::Garrison::GetGarrisonInfoResult::Missions
uint32 WorldPackets::Garrison::GetGarrisonInfoResult::NumFollowerActivationsRemaining = 0
std::vector<GarrisonPlotInfo*> WorldPackets::Garrison::GetGarrisonInfoResult::Plots

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