OregonCore  revision be9e804-git
Your Favourite TBC server
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
 

Detailed Description

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

Definition at line 45 of file Grid.h.

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.

Definition at line 54 of file Grid.h.

54 {}

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.

Definition at line 111 of file Grid.h.

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

Referenced by Map::SwitchGridContainers().

112  {
113  i_container.template insert<SPECIFIC_OBJECT>(obj);
114  ASSERT(obj->IsInGrid());
115  }
#define ASSERT
Definition: Errors.h:29
TypeMapContainer< GRID_OBJECT_TYPES > i_container
Definition: Grid.h:137
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

Definition at line 58 of file Grid.h.

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

Referenced by ObjectAccessor::AddCorpsesToGrid(), and Map::SwitchGridContainers().

59  {
60  i_objects.template insert<SPECIFIC_OBJECT>(obj);
61  ASSERT(obj->IsInGrid());
62  }
TypeMapContainer< WORLD_OBJECT_TYPES > i_objects
Definition: Grid.h:138
#define ASSERT
Definition: Errors.h:29
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.

Definition at line 104 of file Grid.h.

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

105  {
106  return i_objects.template Count<T>();
107  }
TypeMapContainer< WORLD_OBJECT_TYPES > i_objects
Definition: Grid.h:138
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.

Definition at line 88 of file Grid.h.

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

89  {
90  visitor.Visit(i_container);
91  }
void Visit(TYPE_CONTAINER &c)
TypeMapContainer< GRID_OBJECT_TYPES > i_container
Definition: Grid.h:137
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

Definition at line 95 of file Grid.h.

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

96  {
97  visitor.Visit(i_objects);
98  }
TypeMapContainer< WORLD_OBJECT_TYPES > i_objects
Definition: Grid.h:138
void Visit(TYPE_CONTAINER &c)

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

Definition at line 48 of file Grid.h.

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
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: