TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GridLoader.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
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 TRINITY_GRIDLOADER_H
20 #define TRINITY_GRIDLOADER_H
21 
33 //I cannot see why this cannot be replaced by a Grid::Visit
34 /*
35 #include "Define.h"
36 #include "Grid.h"
37 #include "TypeContainerVisitor.h"
38 
39 template
40 <
41 class ACTIVE_OBJECT,
42 class WORLD_OBJECT_TYPES,
43 class GRID_OBJECT_TYPES
44 >
45 class GridLoader
46 {
47  public:
48 
49  // Loads the grid
50  template<class LOADER>
51  void Load(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, LOADER &loader)
52  {
53  grid.LockGrid();
54  loader.Load(grid);
55  grid.UnlockGrid();
56  }
57 
58  // Stop the grid
59  template<class STOPER>
60  void Stop(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, STOPER &stoper)
61  {
62  grid.LockGrid();
63  stoper.Stop(grid);
64  grid.UnlockGrid();
65  }
66 
67  // Unloads the grid
68  template<class UNLOADER>
69  void Unload(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, UNLOADER &unloader)
70  {
71  grid.LockGrid();
72  unloader.Unload(grid);
73  grid.UnlockGrid();
74  }
75 };
76 */
77 #endif