OregonCore  revision fb2a440-git
Your Favourite TBC server
DisableMgr.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore 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 <ace/Singleton.h>
19 #include "Unit.h"
20 
21 #ifndef _DISABLEMGR_H
22 #define _DISABLEMGR_H
23 
25 {
30 };
31 
33 {
44 };
45 
46 #define MAX_DISABLE_TYPES 4
47 
49 {
51  std::set<uint32> params[2]; // params0, params1
52 };
53 
54 typedef std::map<uint32, DisableData> DisableTypeMap; // single disables here with optional data
55 typedef std::map<DisableType, DisableTypeMap> DisableMap; // global disable map by source
56 
58 {
59  friend class ACE_Singleton<DisableMgr, ACE_Null_Mutex>;
60  DisableMgr();
61 
62  public:
63  ~DisableMgr();
64 
65  void LoadDisables();
66  bool IsDisabledFor(DisableType type, uint32 entry, Unit* pUnit, uint8 flags = 0);
67  void CheckQuestDisables();
68 
69  protected:
71 };
72 
73 #define sDisableMgr (*ACE_Singleton<DisableMgr, ACE_Null_Mutex>::instance())
74 
75 #endif //_DISABLEMGR_H
std::map< uint32, DisableData > DisableTypeMap
Definition: DisableMgr.h:54
std::set< uint32 > params[2]
Definition: DisableMgr.h:51
SpellDisableTypes
Definition: DisableMgr.h:32
DisableType
Definition: DisableMgr.h:24
ACE_UINT8 uint8
Definition: Define.h:73
uint8 flags
Definition: DisableMgr.h:50
DisableMap m_DisableMap
Definition: DisableMgr.h:70
std::map< DisableType, DisableTypeMap > DisableMap
Definition: DisableMgr.h:55
ACE_UINT32 uint32
Definition: Define.h:71
Definition: Unit.h:908