Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
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  Skyfire

Macros

#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)

Typedefs

typedef GridRefManager< AreaTriggerAreaTriggerMapType
typedef CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAPCellCoord
typedef GridRefManager< CorpseCorpseMapType
typedef GridRefManager< CreatureCreatureMapType
typedef GridRefManager< DynamicObjectDynamicObjectMapType
typedef GridRefManager< GameObjectGameObjectMapType
typedef CoordPair< MAX_NUMBER_OF_GRIDSGridCoord
typedef Grid< Player, AllWorldObjectTypes, AllGridObjectTypes > GridType
typedef TypeMapContainer< AllGridObjectTypes > GridTypeMapContainer
typedef NGrid< MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes > NGridType
typedef GridRefManager< PlayerPlayerMapType
typedef TypeMapContainer< AllWorldObjectTypes > WorldTypeMapContainer

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

template<class RET_TYPE, int CENTER_VAL>
RET_TYPE Skyfire::Compute (float x, float y, float center_offset, float size)
CellCoord Skyfire::ComputeCellCoord (float x, float y)
CellCoord Skyfire::ComputeCellCoord (float x, float y, float &x_off, float &y_off)
GridCoord Skyfire::ComputeGridCoord (float x, float y)
bool Skyfire::IsValidMapCoord (float c)
bool Skyfire::IsValidMapCoord (float x, float y)
bool Skyfire::IsValidMapCoord (float x, float y, float z)
bool Skyfire::IsValidMapCoord (float x, float y, float z, float o)
void Skyfire::NormalizeMapCoord (float &c)
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)
typedef TYPELIST_4 (Player, Creature, Corpse, DynamicObject) AllWorldObjectTypes
typedef TYPELIST_5 (GameObject, Creature, DynamicObject, Corpse, AreaTrigger) AllGridObjectTypes

Macro Definition Documentation

◆ CENTER_GRID_CELL_ID

#define CENTER_GRID_CELL_ID   (MAX_NUMBER_OF_CELLS*MAX_NUMBER_OF_GRIDS/2)

Definition at line 36 of file GridDefines.h.

Referenced by Skyfire::ComputeCellCoord().

◆ CENTER_GRID_CELL_OFFSET

#define CENTER_GRID_CELL_OFFSET   (SIZE_OF_GRID_CELL/2)

Definition at line 37 of file GridDefines.h.

Referenced by Skyfire::ComputeCellCoord(), and Skyfire::ComputeCellCoord().

◆ CENTER_GRID_ID

#define CENTER_GRID_ID   (MAX_NUMBER_OF_GRIDS/2)

Definition at line 27 of file GridDefines.h.

Referenced by go_commandscript::HandleGoGridCommand().

◆ CENTER_GRID_OFFSET

#define CENTER_GRID_OFFSET   (SIZE_OF_GRIDS/2)

Definition at line 29 of file GridDefines.h.

Referenced by Skyfire::ComputeGridCoord().

◆ MAP_HALFSIZE

#define MAP_HALFSIZE   (MAP_SIZE/2)

Definition at line 44 of file GridDefines.h.

Referenced by Skyfire::IsValidMapCoord(), and Skyfire::NormalizeMapCoord().

◆ MAP_RESOLUTION

◆ MAP_SIZE

#define MAP_SIZE   (SIZE_OF_GRIDS*MAX_NUMBER_OF_GRIDS)

Definition at line 43 of file GridDefines.h.

Referenced by Player::ContinueTaxiFlight().

◆ MAX_NUMBER_OF_CELLS

◆ MAX_NUMBER_OF_GRIDS

#define MAX_NUMBER_OF_GRIDS   64

◆ MIN_GRID_DELAY

#define MIN_GRID_DELAY   (MINUTE*IN_MILLISECONDS)

◆ MIN_MAP_UPDATE_DELAY

#define MIN_MAP_UPDATE_DELAY   50

Definition at line 32 of file GridDefines.h.

Referenced by World::LoadConfigSettings(), and MapManager::SetMapUpdateInterval().

◆ SIZE_OF_GRID_CELL

#define SIZE_OF_GRID_CELL   (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS)

◆ SIZE_OF_GRIDS

◆ TOTAL_NUMBER_OF_CELLS_PER_MAP

#define TOTAL_NUMBER_OF_CELLS_PER_MAP   (MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_CELLS)

Definition at line 39 of file GridDefines.h.

Referenced by Map::ProcessRelocationNotifies(), and Map::VisitNearbyCellsOf().

Typedef Documentation

◆ AreaTriggerMapType

Definition at line 55 of file GridDefines.h.

◆ CellCoord

Definition at line 158 of file GridDefines.h.

◆ CorpseMapType

Definition at line 50 of file GridDefines.h.

◆ CreatureMapType

Definition at line 51 of file GridDefines.h.

◆ DynamicObjectMapType

Definition at line 52 of file GridDefines.h.

◆ GameObjectMapType

Definition at line 53 of file GridDefines.h.

◆ GridCoord

Definition at line 157 of file GridDefines.h.

◆ GridType

typedef Grid<Player, AllWorldObjectTypes, AllGridObjectTypes> GridType

Definition at line 68 of file GridDefines.h.

◆ GridTypeMapContainer

typedef TypeMapContainer<AllGridObjectTypes> GridTypeMapContainer

Definition at line 71 of file GridDefines.h.

◆ NGridType

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

Definition at line 69 of file GridDefines.h.

◆ PlayerMapType

Definition at line 54 of file GridDefines.h.

◆ WorldTypeMapContainer

typedef TypeMapContainer<AllWorldObjectTypes> WorldTypeMapContainer

Definition at line 72 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_ALL 

Definition at line 57 of file GridDefines.h.

Function Documentation

◆ operator!=()

template<uint32 LIMIT>
bool operator!= ( const CoordPair< LIMIT > & p1,
const CoordPair< LIMIT > & p2 )

Definition at line 152 of file GridDefines.h.

◆ operator==()

template<uint32 LIMIT>
bool operator== ( const CoordPair< LIMIT > & p1,
const CoordPair< LIMIT > & p2 )

Definition at line 146 of file GridDefines.h.

References CoordPair< LIMIT >::x_coord, and CoordPair< LIMIT >::y_coord.

◆ TYPELIST_4()

typedef TYPELIST_4 ( Player ,
Creature ,
Corpse ,
DynamicObject  )

◆ TYPELIST_5()

typedef TYPELIST_5 ( GameObject ,
Creature ,
DynamicObject ,
Corpse ,
AreaTrigger  )