MapDifficultyEntry const* GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty /*= nullptr*/) { auto itr = sMapDifficultyMap.find(mapId); if (itr == sMapDifficultyMap.end()) return nullptr; if (itr->second.empty()) return nullptr; for (auto& p : itr->second) { DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(p.first); if (!difficultyEntry) continue; if (difficultyEntry->Flags & DIFFICULTY_FLAG_DEFAULT) { if (difficulty) *difficulty = Difficulty(p.first); return p.second; } } if (difficulty) *difficulty = Difficulty(itr->second.begin()->first); return itr->second.begin()->second; }
MapDifficultyEntry const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty) { auto itr = sMapDifficultyMap.find(mapId); if (itr == sMapDifficultyMap.end()) return nullptr; auto diffItr = itr->second.find(difficulty); if (diffItr == itr->second.end()) return nullptr; return diffItr->second; }
MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty) { MapDifficultyMap::const_iterator itr = sMapDifficultyMap.find(MAKE_PAIR32(mapId,difficulty)); return itr != sMapDifficultyMap.end() ? &itr->second : NULL; }