本文整理汇总了C++中Map::CreateInstanceData方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::CreateInstanceData方法的具体用法?C++ Map::CreateInstanceData怎么用?C++ Map::CreateInstanceData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::CreateInstanceData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateMap
/// @param id - MapId of the to be created map. @param obj WorldObject for which the map is to be created. Must be player for Instancable maps.
Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
{
Guard _guard(*this);
const MapEntry* entry = sMapStore.LookupEntry(id);
if (!entry)
return nullptr;
Map* m;
if (entry->Instanceable())
{
MANGOS_ASSERT(obj && obj->GetTypeId() == TYPEID_PLAYER);
// create DungeonMap object
m = CreateInstance(id, (Player*)obj);
// Load active objects for this map
sObjectMgr.LoadActiveEntities(m);
}
else
{
// create regular non-instanceable map
m = FindMap(id);
if (m == nullptr)
{
m = new WorldMap(id, i_gridCleanUpDelay);
// add map into container
i_maps[MapID(id)] = m;
// non-instanceable maps always expected have saved state
m->CreateInstanceData(true);
}
}
return m;
}
示例2: CreateMap
Map* MapManager::CreateMap(uint32 id, WorldObject const* obj)
{
MANGOS_ASSERT(obj);
//if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId());
Guard _guard(*this);
Map* m = NULL;
MapEntry const* entry = sMapStore.LookupEntry(id);
if(!entry)
return NULL;
if (entry->Instanceable())
{
//create DungeonMap object
if (obj->GetTypeId() == TYPEID_PLAYER)
m = CreateInstance(id, (Player*)obj);
else if (obj->IsInitialized() && obj->GetObjectGuid().IsMOTransport())
DEBUG_FILTER_LOG(LOG_FILTER_TRANSPORT_MOVES,"MapManager::CreateMap %s try create map %u (no instance given), currently not implemented.",obj->IsInitialized() ? obj->GetObjectGuid().GetString().c_str() : "<uninitialized>", id);
else
DETAIL_LOG("MapManager::CreateMap %s try create map %u (no instance given), BUG, wrong usage!",obj->IsInitialized() ? obj->GetObjectGuid().GetString().c_str() : "<uninitialized>", id);
}
else
{
//create regular non-instanceable map
m = FindMap(id);
if( m == NULL )
{
m = new WorldMap(id, i_gridCleanUpDelay);
//add map into container
i_maps[MapID(id)] = m;
// non-instanceable maps always expected have saved state
m->CreateInstanceData(true);
}
}
return m;
}
示例3: CreateMap
Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
{
MANGOS_ASSERT(obj);
//if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId());
Guard _guard(*this);
Map * m = NULL;
const MapEntry* entry = sMapStore.LookupEntry(id);
if(!entry)
return NULL;
if(entry->Instanceable())
{
MANGOS_ASSERT(obj->GetTypeId() == TYPEID_PLAYER);
//create DungeonMap object
if(obj->GetTypeId() == TYPEID_PLAYER)
m = CreateInstance(id, (Player*)obj);
}
else
{
//create regular non-instanceable map
m = FindMap(id);
if( m == NULL )
{
m = new WorldMap(id, i_gridCleanUpDelay);
//add map into container
i_maps[MapID(id)] = m;
// non-instanceable maps always expected have saved state
m->CreateInstanceData(true);
}
}
return m;
}