TrinityCore
GroupMgr.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 _GROUPMGR_H
19#define _GROUPMGR_H
20
21#include "ObjectGuid.h"
22#include <map>
23
24class Group;
25
27{
28private:
29 GroupMgr();
30 ~GroupMgr();
31
32public:
33 static GroupMgr* instance();
34
35 typedef std::map<ObjectGuid::LowType, Group*> GroupContainer;
36 typedef std::vector<Group*> GroupDbContainer;
37
38 Group* GetGroupByGUID(ObjectGuid const& guid) const;
39
40 uint32 GenerateNewGroupDbStoreId();
41 void RegisterGroupDbStoreId(uint32 storageId, Group* group);
42 void FreeGroupDbStoreId(Group* group);
43 void SetNextGroupDbStoreId(uint32 storageId) { NextGroupDbStoreId = storageId; };
44 Group* GetGroupByDbStoreId(uint32 storageId) const;
45 void SetGroupDbStoreSize(uint32 newSize) { GroupDbStore.resize(newSize); }
46
47 void Update(uint32 diff);
48
49 void LoadGroups();
50 ObjectGuid::LowType GenerateGroupId();
51 void AddGroup(Group* group);
52 void RemoveGroup(Group* group);
53
54protected:
59};
60
61#define sGroupMgr GroupMgr::instance()
62
63#endif
#define TC_GAME_API
Definition: Define.h:123
uint32_t uint32
Definition: Define.h:142
std::map< ObjectGuid::LowType, Group * > GroupContainer
Definition: GroupMgr.h:35
ObjectGuid::LowType NextGroupId
Definition: GroupMgr.h:55
void SetNextGroupDbStoreId(uint32 storageId)
Definition: GroupMgr.h:43
std::vector< Group * > GroupDbContainer
Definition: GroupMgr.h:36
GroupDbContainer GroupDbStore
Definition: GroupMgr.h:58
uint32 NextGroupDbStoreId
Definition: GroupMgr.h:56
void SetGroupDbStoreSize(uint32 newSize)
Definition: GroupMgr.h:45
GroupContainer GroupStore
Definition: GroupMgr.h:57
Definition: Group.h:197
uint64 LowType
Definition: ObjectGuid.h:278
void Update(VignetteData &vignette, WorldObject const *owner)
Definition: Vignette.cpp:90