TrinityCore
Loading...
Searching...
No Matches
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 "Group.h"
22
24{
25private:
26 GroupMgr();
27 ~GroupMgr();
28
29public:
30 static GroupMgr* instance();
31
32 typedef std::map<ObjectGuid::LowType, Group*> GroupContainer;
33 typedef std::vector<Group*> GroupDbContainer;
34
35 Group* GetGroupByGUID(ObjectGuid const& guid) const;
36
37 uint32 GenerateNewGroupDbStoreId();
38 void RegisterGroupDbStoreId(uint32 storageId, Group* group);
39 void FreeGroupDbStoreId(Group* group);
40 void SetNextGroupDbStoreId(uint32 storageId) { NextGroupDbStoreId = storageId; };
41 Group* GetGroupByDbStoreId(uint32 storageId) const;
42 void SetGroupDbStoreSize(uint32 newSize) { GroupDbStore.resize(newSize); }
43
44 void Update(uint32 diff);
45
46 void LoadGroups();
47 ObjectGuid::LowType GenerateGroupId();
48 void AddGroup(Group* group);
49 void RemoveGroup(Group* group);
50
51protected:
56};
57
58#define sGroupMgr GroupMgr::instance()
59
60#endif
#define TC_GAME_API
Definition Define.h:114
uint32_t uint32
Definition Define.h:133
std::map< ObjectGuid::LowType, Group * > GroupContainer
Definition GroupMgr.h:32
ObjectGuid::LowType NextGroupId
Definition GroupMgr.h:52
void SetNextGroupDbStoreId(uint32 storageId)
Definition GroupMgr.h:40
std::vector< Group * > GroupDbContainer
Definition GroupMgr.h:33
GroupDbContainer GroupDbStore
Definition GroupMgr.h:55
uint32 NextGroupDbStoreId
Definition GroupMgr.h:53
void SetGroupDbStoreSize(uint32 newSize)
Definition GroupMgr.h:42
GroupContainer GroupStore
Definition GroupMgr.h:54
Definition Group.h:165
uint32 LowType
Definition ObjectGuid.h:142