TrinityCore
Loading...
Searching...
No Matches
LFGPlayerData.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "LFGPlayerData.h"
19
20namespace lfg
21{
22
24 m_Team(0), m_Group(), m_Roles(0), m_Comment(""), m_NumberOfPartyMembersAtJoin(0)
25{ }
26
28
30{
31 switch (state)
32 {
33 case LFG_STATE_NONE:
35 m_Roles = 0;
36 m_SelectedDungeons.clear();
37 m_Comment.clear();
38 [[fallthrough]];
40 m_OldState = state;
41 [[fallthrough]];
42 default:
43 m_State = state;
44 }
45}
46
48{
50 {
51 m_SelectedDungeons.clear();
52 m_Roles = 0;
53 }
55}
56
58{
59 m_Team = team;
60}
61
63{
64 m_Group = group;
65}
66
68{
69 m_Roles = roles;
70}
71
72void LfgPlayerData::SetComment(std::string const& comment)
73{
74 m_Comment = comment;
75}
76
78{
79 m_SelectedDungeons = dungeons;
80}
81
83{
84 return m_State;
85}
86
91
93{
94 return m_Team;
95}
96
98{
99 return m_Group;
100}
101
103{
104 return m_Roles;
105}
106
107std::string const& LfgPlayerData::GetComment() const
108{
109 return m_Comment;
110}
111
116
121
126
127} // namespace lfg
uint8_t uint8
Definition Define.h:135
uint8 m_Team
Player team - determines the queue to join.
LfgState m_OldState
Old State - Used to restore state after failed Rolecheck/Proposal.
LfgState GetOldState() const
uint8 GetNumberOfPartyMembersAtJoin()
uint8 m_Roles
Roles the player selected when joined LFG.
ObjectGuid GetGroup() const
void SetSelectedDungeons(LfgDungeonSet const &dungeons)
std::string const & GetComment() const
void SetState(LfgState state)
ObjectGuid m_Group
Original group of player when joined LFG.
LfgState m_State
State if group in LFG.
void SetGroup(ObjectGuid group)
uint8 m_NumberOfPartyMembersAtJoin
LfgDungeonSet m_SelectedDungeons
Selected Dungeons when joined LFG.
std::string m_Comment
Player comment used when joined LFG.
void SetTeam(uint8 team)
uint8 GetTeam() const
void SetNumberOfPartyMembersAtJoin(uint8 count)
uint8 GetRoles() const
LfgState GetState() const
void SetRoles(uint8 roles)
void SetComment(std::string const &comment)
LfgDungeonSet const & GetSelectedDungeons() const
Definition LFG.cpp:24
LfgState
Definition LFG.h:66
@ LFG_STATE_FINISHED_DUNGEON
Definition LFG.h:73
@ LFG_STATE_DUNGEON
Definition LFG.h:72
@ LFG_STATE_NONE
Definition LFG.h:67
std::set< uint32 > LfgDungeonSet
Definition LFG.h:102