AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
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)
 
GridTypeGetGridType (const uint32 x, const uint32 y)
 
GridType const & GetGridType (const uint32 x, const uint32 y) const
 
uint32 GetGridId () const
 
int32 getX () const
 
int32 getY () const
 
void link (GridRefMgr< NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > > *pTo)
 
bool isGridObjectDataLoaded () const
 
void setGridObjectDataLoaded (bool pLoaded)
 
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)
 

Private Attributes

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

Detailed Description

template<uint32 N, class ACTIVE_OBJECT, class WORLD_OBJECT_TYPES, class GRID_OBJECT_TYPES>
class NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >

NGrid is nothing more than a wrapper of the Grid with an NxN cells

Member Typedef Documentation

◆ GridType

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

◆ NGrid()

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 
)
inline
41 : i_gridId(id), i_x(x), i_y(y), i_GridObjectDataLoaded(false)
42 {
43 }
int32 i_y
Definition: NGrid.h:110
bool i_GridObjectDataLoaded
Definition: NGrid.h:112
uint32 i_gridId
Definition: NGrid.h:107
int32 i_x
Definition: NGrid.h:109

Member Function Documentation

◆ GetGridId()

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 ( ) const
inline

◆ GetGridType() [1/2]

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

◆ GetGridType() [2/2]

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
52 {
53 ASSERT(x < N && y < N);
54 return i_cells[x][y];
55 }

References ASSERT, and NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_cells.

◆ getX()

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

◆ getY()

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

◆ isGridObjectDataLoaded()

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

◆ link()

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 ( GridRefMgr< NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > > *  pTo)
inline
62 {
63 i_Reference.link(pTo, this);
64 }
void link(TO *toObj, FROM *fromObj)
Definition: Reference.h:45
GridReference< NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > > i_Reference
Definition: NGrid.h:108

References NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::i_Reference, and Reference< TO, FROM >::link().

Referenced by Map::buildNGridLinkage().

◆ setGridObjectDataLoaded()

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

◆ VisitAllGrids()

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
93 {
94 for (uint32 x = 0; x < N; ++x)
95 for (uint32 y = 0; y < N; ++y)
96 GetGridType(x, y).Visit(visitor);
97 }
std::uint32_t uint32
Definition: Define.h:107
void Visit(TypeContainerVisitor< T, TypeMapContainer< GRID_OBJECT_TYPES > > &visitor)
Definition: Grid.h:87
GridType & GetGridType(const uint32 x, const uint32 y)
Definition: NGrid.h:45

References NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::GetGridType(), and Grid< ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES >::Visit().

Referenced by Map::UnloadGrid().

◆ VisitGrid()

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

Member Data Documentation

◆ i_cells

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

◆ i_gridId

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

◆ i_GridObjectDataLoaded

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

◆ i_Reference

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

◆ i_x

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

◆ i_y

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