TrinityCore
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

namespace  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   1
 
#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)
 
#define MAX_HEIGHT   100000.0f
 
#define INVALID_HEIGHT   -100000.0f
 
#define MAX_FALL_DISTANCE   250000.0f
 
#define DEFAULT_HEIGHT_SEARCH   50.0f
 

Typedefs

typedef GridRefManager< CorpseCorpseMapType
 
typedef GridRefManager< CreatureCreatureMapType
 
typedef GridRefManager< DynamicObjectDynamicObjectMapType
 
typedef GridRefManager< GameObjectGameObjectMapType
 
typedef GridRefManager< PlayerPlayerMapType
 
typedef GridRefManager< AreaTriggerAreaTriggerMapType
 
typedef GridRefManager< SceneObjectSceneObjectMapType
 
typedef GridRefManager< ConversationConversationMapType
 
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_GRIDSGridCoord
 
typedef CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAPCellCoord
 

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_SCENEOBJECT = 0x40 , GRID_MAP_TYPE_MASK_CONVERSATION = 0x80 ,
  GRID_MAP_TYPE_MASK_ALL = 0xFF
}
 

Functions

typedef TYPELIST_4 (Player, Creature, Corpse, DynamicObject) AllWorldObjectTypes
 
typedef TYPELIST_7 (GameObject, Creature, DynamicObject, Corpse, AreaTrigger, SceneObject, Conversation) AllGridObjectTypes
 
typedef TYPELIST_8 (Creature, GameObject, DynamicObject, Pet, Corpse, AreaTrigger, SceneObject, Conversation) AllMapStoredObjectTypes
 
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)
 
GridCoord Trinity::ComputeGridCoordSimple (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

◆ CENTER_GRID_CELL_ID

#define CENTER_GRID_CELL_ID   (MAX_NUMBER_OF_CELLS*MAX_NUMBER_OF_GRIDS/2)

Definition at line 50 of file GridDefines.h.

◆ CENTER_GRID_CELL_OFFSET

#define CENTER_GRID_CELL_OFFSET   (SIZE_OF_GRID_CELL/2)

Definition at line 51 of file GridDefines.h.

◆ CENTER_GRID_ID

#define CENTER_GRID_ID   (MAX_NUMBER_OF_GRIDS/2)

Definition at line 41 of file GridDefines.h.

◆ CENTER_GRID_OFFSET

#define CENTER_GRID_OFFSET   (SIZE_OF_GRIDS/2)

Definition at line 43 of file GridDefines.h.

◆ DEFAULT_HEIGHT_SEARCH

#define DEFAULT_HEIGHT_SEARCH   50.0f

Definition at line 63 of file GridDefines.h.

◆ INVALID_HEIGHT

#define INVALID_HEIGHT   -100000.0f

Definition at line 61 of file GridDefines.h.

◆ MAP_HALFSIZE

#define MAP_HALFSIZE   (MAP_SIZE/2)

Definition at line 58 of file GridDefines.h.

◆ MAP_RESOLUTION

#define MAP_RESOLUTION   128

Definition at line 55 of file GridDefines.h.

◆ MAP_SIZE

#define MAP_SIZE   (SIZE_OF_GRIDS*MAX_NUMBER_OF_GRIDS)

Definition at line 57 of file GridDefines.h.

◆ MAX_FALL_DISTANCE

#define MAX_FALL_DISTANCE   250000.0f

Definition at line 62 of file GridDefines.h.

◆ MAX_HEIGHT

#define MAX_HEIGHT   100000.0f

Definition at line 60 of file GridDefines.h.

◆ MAX_NUMBER_OF_CELLS

#define MAX_NUMBER_OF_CELLS   8

Definition at line 36 of file GridDefines.h.

◆ MAX_NUMBER_OF_GRIDS

#define MAX_NUMBER_OF_GRIDS   64

Definition at line 38 of file GridDefines.h.

◆ MIN_GRID_DELAY

#define MIN_GRID_DELAY   (MINUTE*IN_MILLISECONDS)

Definition at line 45 of file GridDefines.h.

◆ MIN_MAP_UPDATE_DELAY

#define MIN_MAP_UPDATE_DELAY   1

Definition at line 46 of file GridDefines.h.

◆ SIZE_OF_GRID_CELL

#define SIZE_OF_GRID_CELL   (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS)

Definition at line 48 of file GridDefines.h.

◆ SIZE_OF_GRIDS

#define SIZE_OF_GRIDS   533.3333f

Definition at line 40 of file GridDefines.h.

◆ TOTAL_NUMBER_OF_CELLS_PER_MAP

#define TOTAL_NUMBER_OF_CELLS_PER_MAP   (MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_CELLS)

Definition at line 53 of file GridDefines.h.

Typedef Documentation

◆ AreaTriggerMapType

Definition at line 75 of file GridDefines.h.

◆ CellCoord

Definition at line 178 of file GridDefines.h.

◆ ConversationMapType

Definition at line 77 of file GridDefines.h.

◆ CorpseMapType

Definition at line 70 of file GridDefines.h.

◆ CreatureMapType

Definition at line 71 of file GridDefines.h.

◆ DynamicObjectMapType

Definition at line 72 of file GridDefines.h.

◆ GameObjectMapType

Definition at line 73 of file GridDefines.h.

◆ GridCoord

Definition at line 177 of file GridDefines.h.

◆ GridType

typedef Grid<Player, AllWorldObjectTypes, AllGridObjectTypes> GridType

Definition at line 98 of file GridDefines.h.

◆ GridTypeMapContainer

typedef TypeMapContainer<AllGridObjectTypes> GridTypeMapContainer

Definition at line 101 of file GridDefines.h.

◆ NGridType

typedef NGrid<MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes> NGridType

Definition at line 99 of file GridDefines.h.

◆ PlayerMapType

Definition at line 74 of file GridDefines.h.

◆ SceneObjectMapType

Definition at line 76 of file GridDefines.h.

◆ WorldTypeMapContainer

typedef TypeMapContainer<AllWorldObjectTypes> WorldTypeMapContainer

Definition at line 102 of file GridDefines.h.

Enumeration Type Documentation

◆ GridMapTypeMask

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_SCENEOBJECT 
GRID_MAP_TYPE_MASK_CONVERSATION 
GRID_MAP_TYPE_MASK_ALL 

Definition at line 79 of file GridDefines.h.

Function Documentation

◆ TYPELIST_4()

typedef TYPELIST_4 ( Player  ,
Creature  ,
Corpse  ,
DynamicObject   
)

◆ TYPELIST_7()

typedef TYPELIST_7 ( GameObject  ,
Creature  ,
DynamicObject  ,
Corpse  ,
AreaTrigger  ,
SceneObject  ,
Conversation   
)

◆ TYPELIST_8()

typedef TYPELIST_8 ( Creature  ,
GameObject  ,
DynamicObject  ,
Pet  ,
Corpse  ,
AreaTrigger  ,
SceneObject  ,
Conversation   
)