6#ifndef SKYFIRE_GRIDDEFINES_H
7#define SKYFIRE_GRIDDEFINES_H
22#define MAX_NUMBER_OF_CELLS 8
24#define MAX_NUMBER_OF_GRIDS 64
26#define SIZE_OF_GRIDS 533.3333f
27#define CENTER_GRID_ID (MAX_NUMBER_OF_GRIDS/2)
29#define CENTER_GRID_OFFSET (SIZE_OF_GRIDS/2)
31#define MIN_GRID_DELAY (MINUTE*IN_MILLISECONDS)
32#define MIN_MAP_UPDATE_DELAY 50
34#define SIZE_OF_GRID_CELL (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS)
36#define CENTER_GRID_CELL_ID (MAX_NUMBER_OF_CELLS*MAX_NUMBER_OF_GRIDS/2)
37#define CENTER_GRID_CELL_OFFSET (SIZE_OF_GRID_CELL/2)
39#define TOTAL_NUMBER_OF_CELLS_PER_MAP (MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_CELLS)
41#define MAP_RESOLUTION 128
43#define MAP_SIZE (SIZE_OF_GRIDS*MAX_NUMBER_OF_GRIDS)
44#define MAP_HALFSIZE (MAP_SIZE/2)
145template<u
int32 LIMIT>
151template<u
int32 LIMIT>
162 template<
class RET_TYPE,
int CENTER_VAL>
163 inline RET_TYPE
Compute(
float x,
float y,
float center_offset,
float size)
166 double x_offset = (double(x) - center_offset) / size;
167 double y_offset = (double(y) - center_offset) / size;
169 int x_val = int(x_offset + CENTER_VAL + 0.5f);
170 int y_val = int(y_offset + CENTER_VAL + 0.5f);
171 return RET_TYPE(x_val, y_val);
GridRefManager< Corpse > CorpseMapType
GridRefManager< DynamicObject > DynamicObjectMapType
GridRefManager< Creature > CreatureMapType
GridRefManager< Player > PlayerMapType
CoordPair< MAX_NUMBER_OF_GRIDS > GridCoord
TypeMapContainer< AllWorldObjectTypes > WorldTypeMapContainer
TypeMapContainer< AllGridObjectTypes > GridTypeMapContainer
#define CENTER_GRID_CELL_OFFSET
GridRefManager< AreaTrigger > AreaTriggerMapType
#define CENTER_GRID_CELL_ID
#define SIZE_OF_GRID_CELL
bool operator==(const CoordPair< LIMIT > &p1, const CoordPair< LIMIT > &p2)
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
#define CENTER_GRID_OFFSET
@ GRID_MAP_TYPE_MASK_PLAYER
@ GRID_MAP_TYPE_MASK_CREATURE
@ GRID_MAP_TYPE_MASK_GAMEOBJECT
@ GRID_MAP_TYPE_MASK_DYNAMICOBJECT
@ GRID_MAP_TYPE_MASK_CORPSE
@ GRID_MAP_TYPE_MASK_AREATRIGGER
GridRefManager< GameObject > GameObjectMapType
NGrid< MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes > NGridType
bool operator!=(const CoordPair< LIMIT > &p1, const CoordPair< LIMIT > &p2)
Grid< Player, AllWorldObjectTypes, AllGridObjectTypes > GridType
#define TYPELIST_4(T1, T2, T3, T4)
#define TYPELIST_5(T1, T2, T3, T4, T5)
void NormalizeMapCoord(float &c)
bool IsValidMapCoord(float c)
CellCoord ComputeCellCoord(float x, float y)
GridCoord ComputeGridCoord(float x, float y)
RET_TYPE Compute(float x, float y, float center_offset, float size)
bool IsCoordValid() const
CoordPair< LIMIT > & operator=(const CoordPair< LIMIT > &obj)
CoordPair(uint32 x=0, uint32 y=0)
CoordPair(const CoordPair< LIMIT > &obj)