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

#include <NGrid.h>

Public Types

typedef Grid< ACTIVE_OBJECT,
WORLD_OBJECT_TYPES,
GRID_OBJECT_TYPES > 
GridType
 

Public Member Functions

 NGrid (uint32 id, int32 x, int32 y, time_t expiry, bool unload=true)
 
GridType & GetGridType (const uint32 x, const uint32 y)
 
GridType const & GetGridType (const uint32 x, const uint32 y) const
 
uint32 GetGridId (void) const
 
void SetGridId (const uint32 id) const
 
grid_state_t GetGridState (void) const
 
void SetGridState (grid_state_t s)
 
int32 getX () const
 
int32 getY () const
 
void link (GridRefManager< NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > > *pTo)
 
bool isGridObjectDataLoaded () const
 
void setGridObjectDataLoaded (bool pLoaded)
 
GridInfo * getGridInfoRef ()
 
const TimeTracker & getTimeTracker () const
 
bool getUnloadLock () const
 
void setUnloadExplicitLock (bool on)
 
void setUnloadReferenceLock (bool on)
 
void incUnloadActiveLock ()
 
void decUnloadActiveLock ()
 
void ResetTimeTracker (time_t interval)
 
void UpdateTimeTracker (time_t diff)
 
template<class T , class TT >
void VisitAllGrids (TypeContainerVisitor< T, TypeMapContainer< TT > > &visitor)
 
template<class T , class TT >
void VisitGrid (const uint32 x, const uint32 y, TypeContainerVisitor< T, TypeMapContainer< TT > > &visitor)
 
template<class T >
uint32 GetWorldObjectCountInNGrid () const
 

Private Attributes

uint32 i_gridId
 
GridInfo i_GridInfo
 
GridReference< NGrid< N,
ACTIVE_OBJECT,
WORLD_OBJECT_TYPES,
GRID_OBJECT_TYPES > > 
i_Reference
 
int32 i_x
 
int32 i_y
 
grid_state_t i_cellstate
 
GridType i_cells [N][N]
 
bool i_GridObjectDataLoaded
 

Member Typedef Documentation

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
typedef Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GridType

Constructor & Destructor Documentation

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::NGrid ( uint32  id,
int32  x,
int32  y,
time_t  expiry,
bool  unload = true 
)
inline
81  :
82  i_gridId(id), i_GridInfo(GridInfo(expiry, unload)), i_x(x), i_y(y),
84  { }
grid_state_t i_cellstate
Definition: NGrid.h:189
Definition: NGrid.h:32
int32 i_y
Definition: NGrid.h:188
bool i_GridObjectDataLoaded
Definition: NGrid.h:191
int32 i_x
Definition: NGrid.h:187
Definition: NGrid.h:63
G3D::int16 y
Definition: Vector2int16.h:38
uint32 i_gridId
Definition: NGrid.h:184
G3D::int16 x
Definition: Vector2int16.h:37
GridInfo i_GridInfo
Definition: NGrid.h:185

Member Function Documentation

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::decUnloadActiveLock ( )
inline
void decUnloadActiveLock()
Definition: NGrid.h:46
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
uint32 NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetGridId ( void  ) const
inline
98 { return i_gridId; }
uint32 i_gridId
Definition: NGrid.h:184

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
GridInfo* NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::getGridInfoRef ( )
inline
112 { return &i_GridInfo; }
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
grid_state_t NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetGridState ( void  ) const
inline
100 { return i_cellstate; }
grid_state_t i_cellstate
Definition: NGrid.h:189

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
GridType& NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetGridType ( const uint32  x,
const uint32  y 
)
inline
87  {
88  ASSERT(x < N && y < N);
89  return i_cells[x][y];
90  }
GridType i_cells[N][N]
Definition: NGrid.h:190
G3D::int16 y
Definition: Vector2int16.h:38
#define ASSERT
Definition: Errors.h:55
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
GridType const& NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetGridType ( const uint32  x,
const uint32  y 
) const
inline
93  {
94  ASSERT(x < N && y < N);
95  return i_cells[x][y];
96  }
GridType i_cells[N][N]
Definition: NGrid.h:190
G3D::int16 y
Definition: Vector2int16.h:38
#define ASSERT
Definition: Errors.h:55
G3D::int16 x
Definition: Vector2int16.h:37
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
const TimeTracker& NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::getTimeTracker ( ) const
inline
113 { return i_GridInfo.getTimeTracker(); }
const TimeTracker & getTimeTracker() const
Definition: NGrid.h:41
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the call graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
bool NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::getUnloadLock ( ) const
inline
114 { return i_GridInfo.getUnloadLock(); }
bool getUnloadLock() const
Definition: NGrid.h:42
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the call graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class T >
uint32 NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetWorldObjectCountInNGrid ( ) const
inline
175  {
176  uint32 count = 0;
177  for (uint32 x = 0; x < N; ++x)
178  for (uint32 y = 0; y < N; ++y)
179  count += i_cells[x][y].template GetWorldObjectCountInGrid<T>();
180  return count;
181  }
GridType i_cells[N][N]
Definition: NGrid.h:190
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
int32 NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::getX ( ) const
inline
102 { return i_x; }
int32 i_x
Definition: NGrid.h:187

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
int32 NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::getY ( ) const
inline
103 { return i_y; }
int32 i_y
Definition: NGrid.h:188

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::incUnloadActiveLock ( )
inline
void incUnloadActiveLock()
Definition: NGrid.h:45
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
bool NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::isGridObjectDataLoaded ( ) const
inline
109 { return i_GridObjectDataLoaded; }
bool i_GridObjectDataLoaded
Definition: NGrid.h:191

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::link ( GridRefManager< NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > > *  pTo)
inline
106  {
107  i_Reference.link(pTo, this);
108  }
GridReference< NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > > i_Reference
Definition: NGrid.h:186
void link(TO *toObj, FROM *fromObj)
Definition: Reference.h:46

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::ResetTimeTracker ( time_t  interval)
inline
119 { i_GridInfo.ResetTimeTracker(interval); }
void ResetTimeTracker(time_t interval)
Definition: NGrid.h:49
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::SetGridId ( const uint32  id) const
inline
99 { i_gridId = id; }
uint32 i_gridId
Definition: NGrid.h:184
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::setGridObjectDataLoaded ( bool  pLoaded)
inline
110 { i_GridObjectDataLoaded = pLoaded; }
bool i_GridObjectDataLoaded
Definition: NGrid.h:191
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::SetGridState ( grid_state_t  s)
inline
101 { i_cellstate = s; }
grid_state_t i_cellstate
Definition: NGrid.h:189

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::setUnloadExplicitLock ( bool  on)
inline
void setUnloadExplicitLock(bool on)
Definition: NGrid.h:43
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the call graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::setUnloadReferenceLock ( bool  on)
inline
void setUnloadReferenceLock(bool on)
Definition: NGrid.h:44
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the call graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::UpdateTimeTracker ( time_t  diff)
inline
120 { i_GridInfo.UpdateTimeTracker(diff); }
void UpdateTimeTracker(time_t diff)
Definition: NGrid.h:50
GridInfo i_GridInfo
Definition: NGrid.h:185

+ Here is the call graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class T , class TT >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::VisitAllGrids ( TypeContainerVisitor< T, TypeMapContainer< TT > > &  visitor)
inline
147  {
148  for (uint32 x = 0; x < N; ++x)
149  for (uint32 y = 0; y < N; ++y)
150  GetGridType(x, y).Visit(visitor);
151  }
GridType & GetGridType(const uint32 x, const uint32 y)
Definition: NGrid.h:86
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
void Visit(TypeContainerVisitor< T, TypeMapContainer< GRID_OBJECT_TYPES > > &visitor)
Definition: Grid.h:89
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
template<class T , class TT >
void NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::VisitGrid ( const uint32  x,
const uint32  y,
TypeContainerVisitor< T, TypeMapContainer< TT > > &  visitor 
)
inline
156  {
157  GetGridType(x, y).Visit(visitor);
158  }
GridType & GetGridType(const uint32 x, const uint32 y)
Definition: NGrid.h:86
G3D::int16 y
Definition: Vector2int16.h:38
void Visit(TypeContainerVisitor< T, TypeMapContainer< GRID_OBJECT_TYPES > > &visitor)
Definition: Grid.h:89
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
GridType NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_cells[N][N]
private
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
grid_state_t NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_cellstate
private
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
uint32 NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_gridId
private
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
GridInfo NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_GridInfo
private
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
bool NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_GridObjectDataLoaded
private
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
GridReference<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> > NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_Reference
private
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
int32 NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_x
private
template<uint32 N, class ACTIVE_OBJECT , class WORLD_OBJECT_TYPES , class GRID_OBJECT_TYPES >
int32 NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_y
private

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