TrinityCore
Loading...
Searching...
No Matches
ObjectGridLoader.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 TRINITY_OBJECTGRIDLOADER_H
19#define TRINITY_OBJECTGRIDLOADER_H
20
21#include "TypeList.h"
22#include "Define.h"
23#include "GridLoader.h"
24#include "GridDefines.h"
25#include "Cell.h"
26
27class MapObject;
29
31{
32 friend class ObjectWorldLoader;
33
34 public:
35 ObjectGridLoader(NGridType& grid, Map* map, Cell const& cell)
36 : i_cell(cell), i_grid(grid), i_map(map), i_gameObjects(0), i_creatures(0), i_corpses (0)
37 { }
38
39 void Visit(GameObjectMapType &m);
40 void Visit(CreatureMapType &m);
41 void Visit(CorpseMapType &) const { }
42 void Visit(DynamicObjectMapType&) const { }
43
44 void LoadN(void);
45
46 static void SetObjectCell(MapObject* obj, CellCoord const& cellCoord);
47
48 private:
55};
56
57//Stop the creatures before unloading the NGrid
59{
60 public:
61 void Visit(CreatureMapType &m);
62 template<class T> void Visit(GridRefManager<T> &) { }
63};
64
65//Move the foreign creatures back to respawn positions before unloading the NGrid
67{
68 public:
69 void Visit(CreatureMapType &m);
70 void Visit(GameObjectMapType &m);
71 template<class T> void Visit(GridRefManager<T> &) { }
72};
73
74//Clean up and remove from world
76{
77 public:
78 template<class T> void Visit(GridRefManager<T> &);
79};
80
81//Delete objects before deleting NGrid
83{
84 public:
85 void Visit(CorpseMapType& /*m*/) { } // corpses are deleted with Map
86 template<class T> void Visit(GridRefManager<T> &m);
87};
88#endif
#define TC_GAME_API
Definition Define.h:114
uint32_t uint32
Definition Define.h:133
Definition Map.h:281
Definition NGrid.h:73
void Visit(GridRefManager< T > &)
void Visit(GridRefManager< T > &)
void Visit(CorpseMapType &) const
ObjectGridLoader(NGridType &grid, Map *map, Cell const &cell)
void Visit(DynamicObjectMapType &) const
void Visit(GridRefManager< T > &)
void Visit(CorpseMapType &)
Definition Cell.h:47