TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > Class Template Reference

#include <Grid.h>

Public Member Functions

 ~Grid ()
 
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 T >
uint32 GetWorldObjectCountInGrid () const
 
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
 

Constructor & Destructor Documentation

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

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

55 { }

Member Function Documentation

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.

113  {
114  i_container.template insert<SPECIFIC_OBJECT>(obj);
115  ASSERT(obj->IsInGrid());
116  }
#define ASSERT
Definition: Errors.h:55
TypeMapContainer< GRID_OBJECT_TYPES > i_container
Definition: Grid.h:138

+ Here is the caller graph for this function:

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

60  {
61  i_objects.template insert<SPECIFIC_OBJECT>(obj);
62  ASSERT(obj->IsInGrid());
63  }
TypeMapContainer< WORLD_OBJECT_TYPES > i_objects
Definition: Grid.h:139
#define ASSERT
Definition: Errors.h:55

+ Here is the caller graph for this function:

template<class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class T >
uint32 Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetWorldObjectCountInGrid ( ) const
inline

Returns the number of object within the grid.

106  {
107  return uint32(i_objects.template Count<T>());
108  }
TypeMapContainer< WORLD_OBJECT_TYPES > i_objects
Definition: Grid.h:139
uint32_t uint32
Definition: g3dmath.h:168
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 gridRefreshes/update the grid. This required for remote grids.Locks a grid. Any object enters must wait until the grid is unlock.Unlocks the grid.

90  {
91  visitor.Visit(i_container);
92  }
void Visit(TYPE_CONTAINER &c)
Definition: TypeContainerVisitor.h:90
TypeMapContainer< GRID_OBJECT_TYPES > i_container
Definition: Grid.h:138

+ Here is the caller graph for this function:

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
97  {
98  visitor.Visit(i_objects);
99  }
void Visit(TYPE_CONTAINER &c)
Definition: TypeContainerVisitor.h:90
TypeMapContainer< WORLD_OBJECT_TYPES > i_objects
Definition: Grid.h:139

Friends And Related Function Documentation

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

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

Removes a containter type object from the grid

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

The documentation for this class was generated from the following file: