TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GridDefines.h File Reference
#include "Common.h"
#include "NGrid.h"
#include <cmath>
+ Include dependency graph for GridDefines.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CoordPair< LIMIT >
 

Namespaces

 Trinity
 

Macros

#define MAX_NUMBER_OF_CELLS   8
 
#define MAX_NUMBER_OF_GRIDS   64
 
#define SIZE_OF_GRIDS   533.3333f
 
#define CENTER_GRID_ID   (MAX_NUMBER_OF_GRIDS/2)
 
#define CENTER_GRID_OFFSET   (SIZE_OF_GRIDS/2)
 
#define MIN_GRID_DELAY   (MINUTE*IN_MILLISECONDS)
 
#define MIN_MAP_UPDATE_DELAY   50
 
#define SIZE_OF_GRID_CELL   (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS)
 
#define CENTER_GRID_CELL_ID   (MAX_NUMBER_OF_CELLS*MAX_NUMBER_OF_GRIDS/2)
 
#define CENTER_GRID_CELL_OFFSET   (SIZE_OF_GRID_CELL/2)
 
#define TOTAL_NUMBER_OF_CELLS_PER_MAP   (MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_CELLS)
 
#define MAP_RESOLUTION   128
 
#define MAP_SIZE   (SIZE_OF_GRIDS*MAX_NUMBER_OF_GRIDS)
 
#define MAP_HALFSIZE   (MAP_SIZE/2)
 

Typedefs

typedef GridRefManager< CorpseCorpseMapType
 
typedef GridRefManager< CreatureCreatureMapType
 
typedef GridRefManager
< DynamicObject
DynamicObjectMapType
 
typedef GridRefManager
< GameObject
GameObjectMapType
 
typedef GridRefManager< Player > PlayerMapType
 
typedef GridRefManager
< AreaTrigger
AreaTriggerMapType
 
typedef Grid< Player,
AllWorldObjectTypes,
AllGridObjectTypes > 
GridType
 
typedef NGrid
< MAX_NUMBER_OF_CELLS, Player,
AllWorldObjectTypes,
AllGridObjectTypes > 
NGridType
 
typedef TypeMapContainer
< AllGridObjectTypes > 
GridTypeMapContainer
 
typedef TypeMapContainer
< AllWorldObjectTypes > 
WorldTypeMapContainer
 
typedef CoordPair
< MAX_NUMBER_OF_GRIDS
GridCoord
 
typedef CoordPair
< TOTAL_NUMBER_OF_CELLS_PER_MAP
CellCoord
 

Enumerations

enum  GridMapTypeMask {
  GRID_MAP_TYPE_MASK_CORPSE = 0x01, GRID_MAP_TYPE_MASK_CREATURE = 0x02, GRID_MAP_TYPE_MASK_DYNAMICOBJECT = 0x04, GRID_MAP_TYPE_MASK_GAMEOBJECT = 0x08,
  GRID_MAP_TYPE_MASK_PLAYER = 0x10, GRID_MAP_TYPE_MASK_AREATRIGGER = 0x20, GRID_MAP_TYPE_MASK_ALL = 0x3F
}
 

Functions

typedef TYPELIST_4 (Player, Creature, Corpse, DynamicObject) AllWorldObjectTypes
 
typedef TYPELIST_5 (GameObject, Creature, DynamicObject, Corpse, AreaTrigger) AllGridObjectTypes
 
typedef TYPELIST_6 (Creature, GameObject, DynamicObject, Pet, Corpse, AreaTrigger) AllMapStoredObjectTypes
 
template<uint32 LIMIT>
bool operator== (const CoordPair< LIMIT > &p1, const CoordPair< LIMIT > &p2)
 
template<uint32 LIMIT>
bool operator!= (const CoordPair< LIMIT > &p1, const CoordPair< LIMIT > &p2)
 
template<class RET_TYPE , int CENTER_VAL>
RET_TYPE Trinity::Compute (float x, float y, float center_offset, float size)
 
GridCoord Trinity::ComputeGridCoord (float x, float y)
 
CellCoord Trinity::ComputeCellCoord (float x, float y)
 
CellCoord Trinity::ComputeCellCoord (float x, float y, float &x_off, float &y_off)
 
void Trinity::NormalizeMapCoord (float &c)
 
bool Trinity::IsValidMapCoord (float c)
 
bool Trinity::IsValidMapCoord (float x, float y)
 
bool Trinity::IsValidMapCoord (float x, float y, float z)
 
bool Trinity::IsValidMapCoord (float x, float y, float z, float o)
 

Macro Definition Documentation

#define CENTER_GRID_CELL_ID   (MAX_NUMBER_OF_CELLS*MAX_NUMBER_OF_GRIDS/2)
#define CENTER_GRID_CELL_OFFSET   (SIZE_OF_GRID_CELL/2)
#define CENTER_GRID_ID   (MAX_NUMBER_OF_GRIDS/2)
#define CENTER_GRID_OFFSET   (SIZE_OF_GRIDS/2)
#define MAP_HALFSIZE   (MAP_SIZE/2)
#define MAP_RESOLUTION   128
#define MAP_SIZE   (SIZE_OF_GRIDS*MAX_NUMBER_OF_GRIDS)
#define MAX_NUMBER_OF_CELLS   8
#define MAX_NUMBER_OF_GRIDS   64
#define MIN_GRID_DELAY   (MINUTE*IN_MILLISECONDS)
#define MIN_MAP_UPDATE_DELAY   50
#define SIZE_OF_GRID_CELL   (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS)
#define SIZE_OF_GRIDS   533.3333f
#define TOTAL_NUMBER_OF_CELLS_PER_MAP   (MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_CELLS)

Typedef Documentation

typedef Grid<Player, AllWorldObjectTypes, AllGridObjectTypes> GridType
typedef TypeMapContainer<AllGridObjectTypes> GridTypeMapContainer
typedef NGrid<MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes> NGridType
typedef GridRefManager<Player> PlayerMapType
typedef TypeMapContainer<AllWorldObjectTypes> WorldTypeMapContainer

Enumeration Type Documentation

Enumerator
GRID_MAP_TYPE_MASK_CORPSE 
GRID_MAP_TYPE_MASK_CREATURE 
GRID_MAP_TYPE_MASK_DYNAMICOBJECT 
GRID_MAP_TYPE_MASK_GAMEOBJECT 
GRID_MAP_TYPE_MASK_PLAYER 
GRID_MAP_TYPE_MASK_AREATRIGGER 
GRID_MAP_TYPE_MASK_ALL 
72 {
80 };
Definition: GridDefines.h:78
Definition: GridDefines.h:79
Definition: GridDefines.h:77
Definition: GridDefines.h:76
Definition: GridDefines.h:75
Definition: GridDefines.h:74
Definition: GridDefines.h:73

Function Documentation

template<uint32 LIMIT>
bool operator!= ( const CoordPair< LIMIT > &  p1,
const CoordPair< LIMIT > &  p2 
)
167 {
168  return !(p1 == p2);
169 }
template<uint32 LIMIT>
bool operator== ( const CoordPair< LIMIT > &  p1,
const CoordPair< LIMIT > &  p2 
)
161 {
162  return (p1.x_coord == p2.x_coord && p1.y_coord == p2.y_coord);
163 }
uint32 y_coord
Definition: GridDefines.h:156
uint32 x_coord
Definition: GridDefines.h:155

+ Here is the caller graph for this function:

typedef TYPELIST_4 ( Player  ,
Creature  ,
Corpse  ,
DynamicObject   
)
typedef TYPELIST_5 ( GameObject  ,
Creature  ,
DynamicObject  ,
Corpse  ,
AreaTrigger   
)
typedef TYPELIST_6 ( Creature  ,
GameObject  ,
DynamicObject  ,
Pet  ,
Corpse  ,
AreaTrigger   
)