AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > Class Template Reference

#include "Grid.h"

Public Member Functions

 ~Grid ()=default
 
template<class SPECIFIC_OBJECT >
void AddWorldObject (SPECIFIC_OBJECT *obj)
 
template<class T >
void Visit (TypeContainerVisitor< T, TypeMapContainer< GRID_OBJECT_TYPES > > &visitor)
 
template<class T >
void Visit (TypeContainerVisitor< T, TypeMapContainer< WORLD_OBJECT_TYPES > > &visitor)
 
template<class SPECIFIC_OBJECT >
void AddGridObject (SPECIFIC_OBJECT *obj)
 

Private Attributes

TypeMapContainer< GRID_OBJECT_TYPES > i_container
 
TypeMapContainer< WORLD_OBJECT_TYPES > i_objects
 

Friends

template<class A , class T , class O >
class GridLoader
 

Detailed Description

template<class ACTIVE_OBJECT, class WORLD_OBJECT_TYPES, class GRID_OBJECT_TYPES>
class Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >

Constructor & Destructor Documentation

◆ ~Grid()

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::~Grid ( )
default

destructor to clean up its resources. This includes unloading the grid if it has not been unload.

Member Function Documentation

◆ AddGridObject()

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class SPECIFIC_OBJECT >
void Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::AddGridObject ( SPECIFIC_OBJECT *  obj)
inline

Inserts a container type object into the grid.

102 {
103 i_container.template insert<SPECIFIC_OBJECT>(obj);
104 ASSERT(obj->IsInGrid());
105 }
#define ASSERT
Definition: Errors.h:68
TypeMapContainer< GRID_OBJECT_TYPES > i_container
Definition: Grid.h:126

References ASSERT, and Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_container.

Referenced by Map::AddToGrid(), Map::SwitchGridContainers(), and ObjectWorldLoader::Visit().

◆ AddWorldObject()

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class SPECIFIC_OBJECT >
void Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::AddWorldObject ( SPECIFIC_OBJECT *  obj)
inline

an object of interested enters the grid

58 {
59 i_objects.template insert<SPECIFIC_OBJECT>(obj);
60 ASSERT(obj->IsInGrid());
61 }
TypeMapContainer< WORLD_OBJECT_TYPES > i_objects
Definition: Grid.h:127

References ASSERT, and Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_objects.

Referenced by Map::AddToGrid(), Map::SwitchGridContainers(), and ObjectWorldLoader::Visit().

◆ Visit() [1/2]

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class T >
void Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::Visit ( TypeContainerVisitor< T, TypeMapContainer< GRID_OBJECT_TYPES > > &  visitor)
inline

an object of interested exits the grid Refreshes/update the grid. This required for remote grids. Locks a grid. Any object enters must wait until the grid is unlock. Unlocks the grid.

88 {
89 visitor.Visit(i_container);
90 }
void Visit(TYPE_CONTAINER &c)
Definition: TypeContainerVisitor.h:88

References Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_container.

Referenced by NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::VisitAllGrids(), and NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::VisitGrid().

◆ Visit() [2/2]

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class T >
void Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::Visit ( TypeContainerVisitor< T, TypeMapContainer< WORLD_OBJECT_TYPES > > &  visitor)
inline

Friends And Related Function Documentation

◆ GridLoader

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class A , class T , class O >
friend class GridLoader
friend

Member Data Documentation

◆ i_container

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
TypeMapContainer<GRID_OBJECT_TYPES> Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_container
private

◆ i_objects

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
TypeMapContainer<WORLD_OBJECT_TYPES> Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_objects
private