TrinityCore
Loading...
Searching...
No Matches
WhoListStorage.h
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#ifndef _WHOLISTSTORAGE_H
19#define _WHOLISTSTORAGE_H
20
21#include "Common.h"
22#include "ObjectGuid.h"
23
25{
26public:
27 WhoListPlayerInfo(ObjectGuid guid, uint32 team, AccountTypes security, uint8 level, uint8 clss, uint8 race, uint32 zoneid, uint8 gender, bool visible, std::wstring const& widePlayerName,
28 std::wstring const& wideGuildName, std::string const& playerName, std::string const& guildName) :
29 _guid(guid), _team(team), _security(security), _level(level), _class(clss), _race(race), _zoneid(zoneid), _gender(gender), _visible(visible),
30 _widePlayerName(widePlayerName), _wideGuildName(wideGuildName), _playerName(playerName), _guildName(guildName) {}
31
32 ObjectGuid GetGuid() const { return _guid; }
33 uint32 GetTeam() const { return _team; }
35 uint8 GetLevel() const { return _level; }
36 uint8 GetClass() const { return _class; }
37 uint8 GetRace() const { return _race; }
38 uint32 GetZoneId() const { return _zoneid; }
39 uint8 GetGender() const { return _gender; }
40 bool IsVisible() const { return _visible; }
41 std::wstring const& GetWidePlayerName() const { return _widePlayerName; }
42 std::wstring const& GetWideGuildName() const { return _wideGuildName; }
43 std::string const& GetPlayerName() const { return _playerName; }
44 std::string const& GetGuildName() const { return _guildName; }
45
46private:
56 std::wstring _widePlayerName;
57 std::wstring _wideGuildName;
58 std::string _playerName;
59 std::string _guildName;
60};
61
62typedef std::vector<WhoListPlayerInfo> WhoListInfoVector;
63
65{
66private:
69
70public:
71 static WhoListStorageMgr* instance();
72
73 void Update();
74 WhoListInfoVector const& GetWhoList() const { return _whoListStorage; }
75
76protected:
78};
79
80#define sWhoListStorageMgr WhoListStorageMgr::instance()
81
82#endif // _WHOLISTSTORAGE_H
AccountTypes
Definition Common.h:39
#define TC_GAME_API
Definition Define.h:114
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
std::vector< WhoListPlayerInfo > WhoListInfoVector
uint8 GetClass() const
uint32 GetZoneId() const
std::string _guildName
std::wstring const & GetWidePlayerName() const
std::string _playerName
std::wstring _widePlayerName
std::string const & GetPlayerName() const
std::string const & GetGuildName() const
WhoListPlayerInfo(ObjectGuid guid, uint32 team, AccountTypes security, uint8 level, uint8 clss, uint8 race, uint32 zoneid, uint8 gender, bool visible, std::wstring const &widePlayerName, std::wstring const &wideGuildName, std::string const &playerName, std::string const &guildName)
bool IsVisible() const
uint8 GetGender() const
ObjectGuid GetGuid() const
uint8 GetLevel() const
std::wstring const & GetWideGuildName() const
AccountTypes _security
AccountTypes GetSecurity() const
uint8 GetRace() const
uint32 GetTeam() const
std::wstring _wideGuildName
WhoListInfoVector _whoListStorage
WhoListInfoVector const & GetWhoList() const