TrinityCore
Loading...
Searching...
No Matches
MMAP::MMapManager Class Reference

#include <MMapManager.h>

Public Member Functions

 MMapManager ()
 
 MMapManager (MMapManager const &other)=delete
 
 MMapManager (MMapManager &&other) noexcept=delete
 
MMapManager & operator= (MMapManager const &other)=delete
 
MMapManager & operator= (MMapManager &&other) noexcept=delete
 
 ~MMapManager ()
 
void InitializeThreadUnsafe (std::unordered_map< uint32, std::vector< uint32 > > const &mapData)
 
LoadResult loadMap (std::string_view basePath, uint32 mapId, uint32 instanceId, int32 x, int32 y)
 
bool loadMapInstance (std::string_view basePath, uint32 meshMapId, uint32 instanceMapId, uint32 instanceId)
 
void unloadMap (uint32 mapId, int32 x, int32 y)
 
void unloadMap (uint32 mapId)
 
void unloadMapInstance (uint32 meshMapId, uint32 instanceMapId, uint32 instanceId)
 
dtNavMeshQuery const * GetNavMeshQuery (uint32 meshMapId, uint32 instanceMapId, uint32 instanceId)
 
dtNavMesh * GetNavMesh (uint32 mapId, uint32 instanceId)
 
uint32 getLoadedTilesCount () const
 
uint32 getLoadedMapsCount () const
 

Static Public Member Functions

static MMapManager * instance ()
 
static LoadResult parseNavMeshParamsFile (std::string_view basePath, uint32 mapId, dtNavMeshParams *params, std::vector< OffMeshData > *offmeshConnections=nullptr)
 
static bool isRebuildingTilesEnabledOnMap (uint32 mapId)
 

Private Member Functions

LoadResult loadMapData (std::string_view basePath, uint32 mapId, uint32 instanceId)
 
uint32 packTileID (int32 x, int32 y)
 
MMapDataSet::const_iterator GetMMapData (uint32 mapId) const
 

Private Attributes

MMapDataSet loadedMMaps
 
uint32 loadedTiles = 0
 
std::unordered_map< uint32, uint32 > parentMapData
 

Detailed Description

Definition at line 48 of file MMapManager.h.

Constructor & Destructor Documentation

◆ MMapManager() [1/3]

MMAP::MMapManager::MMapManager ( )
default

◆ MMapManager() [2/3]

MMAP::MMapManager::MMapManager ( MMapManager const &  other)
delete

◆ MMapManager() [3/3]

MMAP::MMapManager::MMapManager ( MMapManager &&  other)
deletenoexcept

◆ ~MMapManager()

MMAP::MMapManager::~MMapManager ( )
default

Member Function Documentation

◆ getLoadedMapsCount()

uint32 MMAP::MMapManager::getLoadedMapsCount ( ) const
inline

Definition at line 73 of file MMapManager.h.

Referenced by mmaps_commandscript::HandleMmapStatsCommand().

◆ getLoadedTilesCount()

uint32 MMAP::MMapManager::getLoadedTilesCount ( ) const
inline

Definition at line 72 of file MMapManager.h.

Referenced by mmaps_commandscript::HandleMmapStatsCommand().

◆ GetMMapData()

MMapDataSet::const_iterator MMAP::MMapManager::GetMMapData ( uint32  mapId) const
private

Definition at line 107 of file MMapManager.cpp.

References loadedMMaps.

Referenced by GetNavMesh(), GetNavMeshQuery(), unloadMap(), and unloadMapInstance().

◆ GetNavMesh()

◆ GetNavMeshQuery()

dtNavMeshQuery const * MMAP::MMapManager::GetNavMeshQuery ( uint32  meshMapId,
uint32  instanceMapId,
uint32  instanceId 
)

◆ InitializeThreadUnsafe()

void MMAP::MMapManager::InitializeThreadUnsafe ( std::unordered_map< uint32, std::vector< uint32 > > const &  mapData)

Definition at line 96 of file MMapManager.cpp.

References loadedMMaps, and parentMapData.

Referenced by World::SetInitialWorldSettings().

◆ instance()

◆ isRebuildingTilesEnabledOnMap()

bool MMAP::MMapManager::isRebuildingTilesEnabledOnMap ( uint32  mapId)
static

Definition at line 117 of file MMapManager.cpp.

References MMAP::MMapData::GetInstanceIdForMeshLookup().

Referenced by Map::Map(), unloadMap(), and unloadMapInstance().

◆ loadMap()

◆ loadMapData()

LoadResult MMAP::MMapManager::loadMapData ( std::string_view  basePath,
uint32  mapId,
uint32  instanceId 
)
private

◆ loadMapInstance()

bool MMAP::MMapManager::loadMapInstance ( std::string_view  basePath,
uint32  meshMapId,
uint32  instanceMapId,
uint32  instanceId 
)

◆ operator=() [1/2]

MMapManager & MMAP::MMapManager::operator= ( MMapManager &&  other)
deletenoexcept

◆ operator=() [2/2]

MMapManager & MMAP::MMapManager::operator= ( MMapManager const &  other)
delete

◆ packTileID()

uint32 MMAP::MMapManager::packTileID ( int32  x,
int32  y 
)
private

Definition at line 201 of file MMapManager.cpp.

Referenced by loadMap(), and unloadMap().

◆ parseNavMeshParamsFile()

LoadResult MMAP::MMapManager::parseNavMeshParamsFile ( std::string_view  basePath,
uint32  mapId,
dtNavMeshParams *  params,
std::vector< OffMeshData > *  offmeshConnections = nullptr 
)
static

◆ unloadMap() [1/2]

void MMAP::MMapManager::unloadMap ( uint32  mapId)

◆ unloadMap() [2/2]

void MMAP::MMapManager::unloadMap ( uint32  mapId,
int32  x,
int32  y 
)

◆ unloadMapInstance()

void MMAP::MMapManager::unloadMapInstance ( uint32  meshMapId,
uint32  instanceMapId,
uint32  instanceId 
)

Member Data Documentation

◆ loadedMMaps

◆ loadedTiles

uint32 MMAP::MMapManager::loadedTiles = 0
private

Definition at line 83 of file MMapManager.h.

Referenced by loadMap(), unloadMap(), unloadMap(), and unloadMapInstance().

◆ parentMapData

std::unordered_map<uint32, uint32> MMAP::MMapManager::parentMapData
private

Definition at line 85 of file MMapManager.h.

Referenced by InitializeThreadUnsafe(), and loadMap().


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