TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ScriptSystem.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef SC_SYSTEM_H
20 #define SC_SYSTEM_H
21 
22 #include "ScriptMgr.h"
23 
24 #define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available
25 
27 //N=Neutral, A=Alliance, H=Horde.
28 //NEUTRAL or FRIEND = Hostility to player surroundings (not a good definition)
29 //ACTIVE or PASSIVE = Hostility to environment surroundings.
31 {
35 
39 
42 
45 
48 };
49 
51 {
54  float fX;
55  float fY;
56  float fZ;
58 };
59 
60 typedef std::vector<ScriptPointMove> ScriptPointVector;
61 
63 {
64  private:
65  SystemMgr() { }
66  ~SystemMgr() { }
67 
68  public:
69  static SystemMgr* instance();
70 
71  typedef std::unordered_map<uint32, ScriptPointVector> PointMoveMap;
72 
73  //Database
74  void LoadScriptWaypoints();
75 
76  ScriptPointVector const& GetPointMoveList(uint32 creatureEntry) const
77  {
78  PointMoveMap::const_iterator itr = m_mPointMoveMap.find(creatureEntry);
79 
80  if (itr == m_mPointMoveMap.end())
81  return _empty;
82 
83  return itr->second;
84  }
85 
86  protected:
87  PointMoveMap m_mPointMoveMap; //coordinates for waypoints
88 
89  private:
90  static ScriptPointVector const _empty;
91 };
92 
93 #define sScriptSystemMgr SystemMgr::instance()
94 
95 #endif
float fZ
Definition: ScriptSystem.h:56
Definition: ScriptSystem.h:46
ScriptPointVector const & GetPointMoveList(uint32 creatureEntry) const
Definition: ScriptSystem.h:76
Definition: ScriptSystem.h:32
Definition: ScriptSystem.h:37
PointMoveMap m_mPointMoveMap
Definition: ScriptSystem.h:87
Definition: ScriptSystem.h:34
Definition: ScriptSystem.h:43
SystemMgr()
Definition: ScriptSystem.h:65
float fY
Definition: ScriptSystem.h:55
std::unordered_map< uint32, ScriptPointVector > PointMoveMap
Definition: ScriptSystem.h:71
Definition: ScriptSystem.h:38
~SystemMgr()
Definition: ScriptSystem.h:66
Definition: ScriptSystem.h:44
float fX
Definition: ScriptSystem.h:54
Definition: ScriptSystem.h:50
uint32 uiPointId
Definition: ScriptSystem.h:53
Definition: ScriptSystem.h:36
uint32_t uint32
Definition: Define.h:150
static ScriptPointVector const _empty
Definition: ScriptSystem.h:90
uint32 uiCreatureEntry
Definition: ScriptSystem.h:52
#define TC_GAME_API
Definition: Define.h:134
eEscortFaction
Definition: ScriptSystem.h:30
Definition: ScriptSystem.h:41
Definition: ScriptSystem.h:47
std::vector< ScriptPointMove > ScriptPointVector
Definition: ScriptSystem.h:60
uint32 uiWaitTime
Definition: ScriptSystem.h:57
Definition: ScriptSystem.h:40
Definition: ScriptSystem.h:62
Definition: ScriptSystem.h:33