TrinityCore
ScriptSystem.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 SC_SYSTEM_H
19#define SC_SYSTEM_H
20
21#include "Define.h"
22#include "Hash.h"
23#include "WaypointDefines.h"
24#include <unordered_map>
25#include <vector>
26
27class Creature;
28struct SplineChainLink;
29
31{
32 public:
33 static SystemMgr* instance();
34
35 // database
36 void LoadScriptSplineChains();
37
38 std::vector<SplineChainLink> const* GetSplineChain(uint32 entry, uint16 chainId) const;
39 std::vector<SplineChainLink> const* GetSplineChain(Creature const* who, uint16 id) const;
40
41 private:
42 typedef std::pair<uint32, uint16> ChainKeyType; // creature entry + chain ID
43
46
47 SystemMgr(SystemMgr const&) = delete;
48 SystemMgr& operator=(SystemMgr const&) = delete;
49
50 std::unordered_map<ChainKeyType, std::vector<SplineChainLink>> m_mSplineChainsMap; // spline chains
51};
52
53#define sScriptSystemMgr SystemMgr::instance()
54
55#endif
#define TC_GAME_API
Definition: Define.h:123
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
SystemMgr & operator=(SystemMgr const &)=delete
std::unordered_map< ChainKeyType, std::vector< SplineChainLink > > m_mSplineChainsMap
Definition: ScriptSystem.h:50
std::pair< uint32, uint16 > ChainKeyType
Definition: ScriptSystem.h:42
SystemMgr(SystemMgr const &)=delete