AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
lfg::LfgGroupData Class Reference

#include "LFGGroupData.h"

Public Member Functions

 LfgGroupData ()
 
 ~LfgGroupData ()
 
bool IsLfgGroup ()
 
void SetState (LfgState state)
 
void RestoreState ()
 
void AddPlayer (ObjectGuid guid)
 
uint8 RemovePlayer (ObjectGuid guid)
 
void RemoveAllPlayers ()
 
void SetLeader (ObjectGuid guid)
 
void SetDungeon (uint32 dungeon)
 
void DecreaseKicksLeft ()
 
LfgState GetState () const
 
LfgState GetOldState () const
 
LfgGuidSet const & GetPlayers () const
 
uint8 GetPlayerCount () const
 
ObjectGuid GetLeader () const
 
uint32 GetDungeon (bool asId=true) const
 
uint8 GetKicksLeft () const
 

Private Attributes

LfgState m_State
 State if group in LFG. More...
 
LfgState m_OldState
 Old State. More...
 
ObjectGuid m_Leader
 Leader GUID. More...
 
LfgGuidSet m_Players
 Players in group. More...
 
uint32 m_Dungeon
 Dungeon entry. More...
 
bool _isLFGGroup
 
uint8 m_KicksLeft
 Number of kicks left. More...
 

Detailed Description

Stores all lfg data needed about a group.

Constructor & Destructor Documentation

◆ LfgGroupData()

lfg::LfgGroupData::LfgGroupData ( )
26 { }
@ CONFIG_LFG_MAX_KICK_COUNT
Definition: IWorld.h:416
#define sWorld
Definition: World.h:443
@ LFG_STATE_NONE
Definition: LFG.h:68
uint8 m_KicksLeft
Number of kicks left.
Definition: LFGGroupData.h:73
bool _isLFGGroup
Definition: LFGGroupData.h:71
uint32 m_Dungeon
Dungeon entry.
Definition: LFGGroupData.h:70
LfgState m_State
State if group in LFG.
Definition: LFGGroupData.h:65
LfgState m_OldState
Old State.
Definition: LFGGroupData.h:66

◆ ~LfgGroupData()

lfg::LfgGroupData::~LfgGroupData ( )
29 { }

Member Function Documentation

◆ AddPlayer()

void lfg::LfgGroupData::AddPlayer ( ObjectGuid  guid)
71 {
72 m_Players.insert(guid);
73 }
LfgGuidSet m_Players
Players in group.
Definition: LFGGroupData.h:68

References m_Players.

◆ DecreaseKicksLeft()

void lfg::LfgGroupData::DecreaseKicksLeft ( )
99 {
100 if (m_KicksLeft)
101 --m_KicksLeft;
102 }

References m_KicksLeft.

◆ GetDungeon()

uint32 lfg::LfgGroupData::GetDungeon ( bool  asId = true) const
130 {
131 if (asId)
132 return (m_Dungeon & 0x00FFFFFF);
133 else
134 return m_Dungeon;
135 }

References m_Dungeon.

◆ GetKicksLeft()

uint8 lfg::LfgGroupData::GetKicksLeft ( ) const
138 {
139 return m_KicksLeft;
140 }

References m_KicksLeft.

◆ GetLeader()

ObjectGuid lfg::LfgGroupData::GetLeader ( ) const
125 {
126 return m_Leader;
127 }
ObjectGuid m_Leader
Leader GUID.
Definition: LFGGroupData.h:67

References m_Leader.

◆ GetOldState()

LfgState lfg::LfgGroupData::GetOldState ( ) const
110 {
111 return m_OldState;
112 }

References m_OldState.

Referenced by lfg::LFGMgr::SetState().

◆ GetPlayerCount()

uint8 lfg::LfgGroupData::GetPlayerCount ( ) const
120 {
121 return m_Players.size();
122 }

References m_Players.

◆ GetPlayers()

LfgGuidSet const & lfg::LfgGroupData::GetPlayers ( ) const
115 {
116 return m_Players;
117 }

References m_Players.

◆ GetState()

LfgState lfg::LfgGroupData::GetState ( ) const
105 {
106 return m_State;
107 }

References m_State.

Referenced by lfg::LFGMgr::SetState().

◆ IsLfgGroup()

bool lfg::LfgGroupData::IsLfgGroup ( )
32 {
33 return _isLFGGroup;
34 }

References _isLFGGroup.

◆ RemoveAllPlayers()

void lfg::LfgGroupData::RemoveAllPlayers ( )
84 {
85 m_Players.clear();
86 }

References m_Players.

◆ RemovePlayer()

uint8 lfg::LfgGroupData::RemovePlayer ( ObjectGuid  guid)
76 {
77 LfgGuidSet::iterator it = m_Players.find(guid);
78 if (it != m_Players.end())
79 m_Players.erase(it);
80 return uint8(m_Players.size());
81 }
std::uint8_t uint8
Definition: Define.h:109

References m_Players.

◆ RestoreState()

void lfg::LfgGroupData::RestoreState ( )
66 {
68 }

References m_OldState, and m_State.

Referenced by lfg::LFGMgr::RestoreState().

◆ SetDungeon()

void lfg::LfgGroupData::SetDungeon ( uint32  dungeon)
94 {
95 m_Dungeon = dungeon;
96 }

References m_Dungeon.

◆ SetLeader()

void lfg::LfgGroupData::SetLeader ( ObjectGuid  guid)
89 {
90 m_Leader = guid;
91 }

References m_Leader.

◆ SetState()

void lfg::LfgGroupData::SetState ( LfgState  state)
37 {
38 switch (state)
39 {
41 _isLFGGroup = true;
42 break;
44 _isLFGGroup = false;
45 break;
46 default:
47 break;
48 }
49
50 switch (state)
51 {
52 case LFG_STATE_NONE:
53 m_Dungeon = 0;
55 [[fallthrough]];
58 m_OldState = state;
59 [[fallthrough]];
60 default:
61 m_State = state;
62 }
63 }
@ LFG_STATE_FINISHED_DUNGEON
Definition: LFG.h:74
@ LFG_STATE_DUNGEON
Definition: LFG.h:73

References _isLFGGroup, CONFIG_LFG_MAX_KICK_COUNT, lfg::LFG_STATE_DUNGEON, lfg::LFG_STATE_FINISHED_DUNGEON, lfg::LFG_STATE_NONE, m_Dungeon, m_KicksLeft, m_OldState, m_State, and sWorld.

Referenced by lfg::LFGMgr::SetState().

Member Data Documentation

◆ _isLFGGroup

bool lfg::LfgGroupData::_isLFGGroup
private

Referenced by IsLfgGroup(), and SetState().

◆ m_Dungeon

uint32 lfg::LfgGroupData::m_Dungeon
private

Dungeon entry.

Referenced by GetDungeon(), SetDungeon(), and SetState().

◆ m_KicksLeft

uint8 lfg::LfgGroupData::m_KicksLeft
private

Number of kicks left.

Referenced by DecreaseKicksLeft(), GetKicksLeft(), and SetState().

◆ m_Leader

ObjectGuid lfg::LfgGroupData::m_Leader
private

Leader GUID.

Referenced by GetLeader(), and SetLeader().

◆ m_OldState

LfgState lfg::LfgGroupData::m_OldState
private

Old State.

Referenced by GetOldState(), RestoreState(), and SetState().

◆ m_Players

LfgGuidSet lfg::LfgGroupData::m_Players
private

◆ m_State

LfgState lfg::LfgGroupData::m_State
private

State if group in LFG.

Referenced by GetState(), RestoreState(), and SetState().