TrinityCore
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, bool gamemaster, std::wstring const& widePlayerName,
28 std::wstring const& wideGuildName, std::string const& playerName, std::string const& guildName, ObjectGuid guildguid) :
29 _guid(guid), _team(team), _security(security), _level(level), _class(clss), _race(race), _zoneid(zoneid), _gender(gender), _visible(visible),
30 _gamemaster(gamemaster), _widePlayerName(widePlayerName), _wideGuildName(wideGuildName), _playerName(playerName), _guildName(guildName), _guildguid(guildguid) {}
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 bool IsGameMaster() const { return _gamemaster; }
42 std::wstring const& GetWidePlayerName() const { return _widePlayerName; }
43 std::wstring const& GetWideGuildName() const { return _wideGuildName; }
44 std::string const& GetPlayerName() const { return _playerName; }
45 std::string const& GetGuildName() const { return _guildName; }
47
48private:
59 std::wstring _widePlayerName;
60 std::wstring _wideGuildName;
61 std::string _playerName;
62 std::string _guildName;
64};
65
66typedef std::vector<WhoListPlayerInfo> WhoListInfoVector;
67
69{
70private:
73
74public:
75 static WhoListStorageMgr* instance();
76
77 void Update();
78 WhoListInfoVector const& GetWhoList() const { return _whoListStorage; }
79
80protected:
82};
83
84#define sWhoListStorageMgr WhoListStorageMgr::instance()
85
86#endif // _WHOLISTSTORAGE_H
AccountTypes
Definition: Common.h:39
#define TC_GAME_API
Definition: Define.h:123
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
std::vector< WhoListPlayerInfo > WhoListInfoVector
bool IsGameMaster() const
WhoListPlayerInfo(ObjectGuid guid, uint32 team, AccountTypes security, uint8 level, uint8 clss, uint8 race, uint32 zoneid, uint8 gender, bool visible, bool gamemaster, std::wstring const &widePlayerName, std::wstring const &wideGuildName, std::string const &playerName, std::string const &guildName, ObjectGuid guildguid)
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
bool IsVisible() const
uint8 GetGender() const
ObjectGuid GetGuildGuid() const
ObjectGuid GetGuid() const
uint8 GetLevel() const
std::wstring const & GetWideGuildName() const
AccountTypes _security
AccountTypes GetSecurity() const
uint8 GetRace() const
ObjectGuid _guildguid
uint32 GetTeam() const
std::wstring _wideGuildName
WhoListInfoVector _whoListStorage
WhoListInfoVector const & GetWhoList() const
void Update(VignetteData &vignette, WorldObject const *owner)
Definition: Vignette.cpp:90