OregonCore  revision 3611e8a-git
Your Favourite TBC server
MMAP::MMapFactory Class Reference

#include <MoveMap.h>

Static Public Member Functions

static MMapManagercreateOrGetMMapManager ()
 
static void clear ()
 
static void preventPathfindingOnMaps (const char *ignoreMapIds)
 
static bool IsPathfindingEnabled (uint32 mapId)
 

Detailed Description

Definition at line 107 of file MoveMap.h.

Member Function Documentation

void MMAP::MMapFactory::clear ( )
static

Definition at line 67 of file MoveMap.cpp.

References MMAP::g_mmapDisabledIds, and MMAP::g_MMapManager.

Referenced by World::~World().

68 {
70  {
71  delete g_mmapDisabledIds;
72  g_mmapDisabledIds = NULL;
73  }
74 
75  if (g_MMapManager)
76  {
77  delete g_MMapManager;
78  g_MMapManager = NULL;
79  }
80 }
MMapManager * g_MMapManager
Definition: MoveMap.cpp:29
std::set< uint32 > * g_mmapDisabledIds
Definition: MoveMap.cpp:32
MMapManager * MMAP::MMapFactory::createOrGetMMapManager ( )
static

Definition at line 34 of file MoveMap.cpp.

References MMAP::g_MMapManager.

Referenced by Map::LoadMMap(), PathInfo::PathInfo(), World::SetInitialWorldSettings(), and Map::UnloadGrid().

35 {
36  if (g_MMapManager == NULL)
37  g_MMapManager = new MMapManager();
38 
39  return g_MMapManager;
40 }
MMapManager * g_MMapManager
Definition: MoveMap.cpp:29
bool MMAP::MMapFactory::IsPathfindingEnabled ( uint32  mapId)
static

Definition at line 61 of file MoveMap.cpp.

References CONFIG_BOOL_MMAP_ENABLED, and sWorld.

Referenced by Map::LoadMMap(), and PathInfo::PathInfo().

62 {
63  return sWorld.getConfig(CONFIG_BOOL_MMAP_ENABLED)
64  && g_mmapDisabledIds->find(mapId) == g_mmapDisabledIds->end();
65 }
std::set< uint32 > * g_mmapDisabledIds
Definition: MoveMap.cpp:32
#define sWorld
Definition: World.h:860
void MMAP::MMapFactory::preventPathfindingOnMaps ( const char *  ignoreMapIds)
static

Definition at line 42 of file MoveMap.cpp.

Referenced by World::LoadConfigSettings().

43 {
44  if (!g_mmapDisabledIds)
45  g_mmapDisabledIds = new std::set<uint32>();
46 
47  uint32 strLenght = strlen(ignoreMapIds) + 1;
48  char* mapList = new char[strLenght];
49  memcpy(mapList, ignoreMapIds, sizeof(char)*strLenght);
50 
51  char* idstr = strtok(mapList, ",");
52  while (idstr)
53  {
54  g_mmapDisabledIds->insert(uint32(atoi(idstr)));
55  idstr = strtok(NULL, ",");
56  }
57 
58  delete[] mapList;
59 }
std::set< uint32 > * g_mmapDisabledIds
Definition: MoveMap.cpp:32
ACE_UINT32 uint32
Definition: Define.h:71

The documentation for this class was generated from the following files: