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
27
class
MapObject
;
28
class
ObjectWorldLoader
;
29
30
class
TC_GAME_API
ObjectGridLoader
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
:
49
Cell
i_cell
;
50
NGridType
&
i_grid
;
51
Map
*
i_map
;
52
uint32
i_gameObjects
;
53
uint32
i_creatures
;
54
uint32
i_corpses
;
55
};
56
57
//Stop the creatures before unloading the NGrid
58
class
TC_GAME_API
ObjectGridStoper
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
66
class
TC_GAME_API
ObjectGridEvacuator
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
75
class
ObjectGridCleaner
76
{
77
public
:
78
template
<
class
T>
void
Visit
(
GridRefManager<T>
&);
79
};
80
81
//Delete objects before deleting NGrid
82
class
ObjectGridUnloader
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
Cell.h
Define.h
TC_GAME_API
#define TC_GAME_API
Definition
Define.h:114
uint32
uint32_t uint32
Definition
Define.h:133
GridDefines.h
GridLoader.h
TypeList.h
GridRefManager< GameObject >
Map
Definition
Map.h:281
NGrid
Definition
NGrid.h:73
ObjectGridCleaner
Definition
ObjectGridLoader.h:76
ObjectGridCleaner::Visit
void Visit(GridRefManager< T > &)
Definition
ObjectGridLoader.cpp:210
ObjectGridEvacuator
Definition
ObjectGridLoader.h:67
ObjectGridEvacuator::Visit
void Visit(GridRefManager< T > &)
Definition
ObjectGridLoader.h:71
ObjectGridLoader
Definition
ObjectGridLoader.h:31
ObjectGridLoader::i_cell
Cell i_cell
Definition
ObjectGridLoader.h:49
ObjectGridLoader::i_creatures
uint32 i_creatures
Definition
ObjectGridLoader.h:53
ObjectGridLoader::i_map
Map * i_map
Definition
ObjectGridLoader.h:51
ObjectGridLoader::i_corpses
uint32 i_corpses
Definition
ObjectGridLoader.h:54
ObjectGridLoader::i_gameObjects
uint32 i_gameObjects
Definition
ObjectGridLoader.h:52
ObjectGridLoader::Visit
void Visit(CorpseMapType &) const
Definition
ObjectGridLoader.h:41
ObjectGridLoader::ObjectGridLoader
ObjectGridLoader(NGridType &grid, Map *map, Cell const &cell)
Definition
ObjectGridLoader.h:35
ObjectGridLoader::Visit
void Visit(DynamicObjectMapType &) const
Definition
ObjectGridLoader.h:42
ObjectGridLoader::i_grid
NGridType & i_grid
Definition
ObjectGridLoader.h:50
ObjectGridStoper
Definition
ObjectGridLoader.h:59
ObjectGridStoper::Visit
void Visit(GridRefManager< T > &)
Definition
ObjectGridLoader.h:62
ObjectGridUnloader
Definition
ObjectGridLoader.h:83
ObjectGridUnloader::Visit
void Visit(CorpseMapType &)
Definition
ObjectGridLoader.h:85
ObjectWorldLoader
Definition
ObjectGridLoader.cpp:64
MapObject
Definition
wmo.h:161
Cell
Definition
Cell.h:47
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP >
server
game
Grids
ObjectGridLoader.h
Generated on Sun May 10 2026 02:30:16 for TrinityCore by
1.9.8