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

#include <MiscPackets.h>

Public Member Functions

 SaveCUFProfiles (WorldPacket &&packet)
 
void Read () override
 
- Public Member Functions inherited from WorldPackets::ClientPacket
 ClientPacket (WorldPacket &&packet)
 
 ClientPacket (OpcodeClient expectedOpcode, WorldPacket &&packet)
 
WorldPacket constWrite () overridefinal
 
OpcodeClient 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

std::vector< std::unique_ptr
< CUFProfile > > 
CUFProfiles
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Misc::SaveCUFProfiles::SaveCUFProfiles ( WorldPacket &&  packet)
inline
652 : ClientPacket(CMSG_SAVE_CUF_PROFILES, std::move(packet)) { }
Definition: Opcodes.h:588
ClientPacket(WorldPacket &&packet)
Definition: Packet.h:62

Member Function Documentation

void WorldPackets::Misc::SaveCUFProfiles::Read ( )
overridevirtual

Implements WorldPackets::Packet.

459 {
460  uint32 count;
461  _worldPacket >> count;
462 
463  for (uint8 i = 0; i < count && i < MAX_CUF_PROFILES; i++)
464  {
465  std::unique_ptr<CUFProfile> cufProfile = Trinity::make_unique<CUFProfile>();
466 
467  uint8 strLen = _worldPacket.ReadBits(7);
468 
469  // Bool Options
470  for (uint8 option = 0; option < CUF_BOOL_OPTIONS_COUNT; option++)
471  cufProfile->BoolOptions.set(option, _worldPacket.ReadBit());
472 
473  // Other Options
474  _worldPacket >> cufProfile->FrameHeight;
475  _worldPacket >> cufProfile->FrameWidth;
476 
477  _worldPacket >> cufProfile->SortBy;
478  _worldPacket >> cufProfile->HealthText;
479 
480  _worldPacket >> cufProfile->TopPoint;
481  _worldPacket >> cufProfile->BottomPoint;
482  _worldPacket >> cufProfile->LeftPoint;
483 
484  _worldPacket >> cufProfile->TopOffset;
485  _worldPacket >> cufProfile->BottomOffset;
486  _worldPacket >> cufProfile->LeftOffset;
487 
488  cufProfile->ProfileName = _worldPacket.ReadString(strLen);
489 
490  CUFProfiles.push_back(std::move(cufProfile));
491  }
492 }
uint8 SortBy
Definition: Player.h:274
#define MAX_CUF_PROFILES
Maximum number of CompactUnitFrames profiles.
Definition: Player.h:202
uint32 ReadBits(int32 bits)
Definition: ByteBuffer.h:204
std::vector< std::unique_ptr< CUFProfile > > CUFProfiles
Definition: MiscPackets.h:656
WorldPacket _worldPacket
Definition: Packet.h:43
uint16 LeftOffset
Definition: Player.h:285
uint16 TopOffset
Definition: Player.h:283
uint16 FrameWidth
Definition: Player.h:273
std::bitset< CUF_BOOL_OPTIONS_COUNT > BoolOptions
Definition: Player.h:287
std::string ReadString(uint32 length)
Definition: ByteBuffer.h:524
uint16 BottomOffset
Definition: Player.h:284
uint32_t uint32
Definition: Define.h:150
Definition: Player.h:235
uint8 BottomPoint
Definition: Player.h:279
uint8 HealthText
Definition: Player.h:275
uint8 TopPoint
Definition: Player.h:278
uint8_t uint8
Definition: Define.h:152
uint16 FrameHeight
Definition: Player.h:272
uint8 LeftPoint
Definition: Player.h:280
bool ReadBit()
Definition: ByteBuffer.h:186
std::string ProfileName
Definition: Player.h:271

Member Data Documentation

std::vector<std::unique_ptr<CUFProfile> > WorldPackets::Misc::SaveCUFProfiles::CUFProfiles

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