2026-02-02 12:24:50 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace wowee {
|
2026-03-09 16:04:52 -07:00
|
|
|
namespace pipeline { class AssetManager; }
|
2026-02-02 12:24:50 -08:00
|
|
|
namespace game {
|
|
|
|
|
|
|
|
|
|
struct ZoneInfo {
|
|
|
|
|
uint32_t id;
|
|
|
|
|
std::string name;
|
|
|
|
|
std::vector<std::string> musicPaths; // MPQ paths to music files
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ZoneManager {
|
|
|
|
|
public:
|
|
|
|
|
void initialize();
|
|
|
|
|
|
2026-03-09 16:04:52 -07:00
|
|
|
// Supplement zone music paths using AreaTable → ZoneMusic → SoundEntries DBC chain.
|
|
|
|
|
// Safe to call after initialize(); idempotent and additive (does not remove existing paths).
|
|
|
|
|
void enrichFromDBC(pipeline::AssetManager* assets);
|
|
|
|
|
|
2026-02-02 12:24:50 -08:00
|
|
|
uint32_t getZoneId(int tileX, int tileY) const;
|
|
|
|
|
const ZoneInfo* getZoneInfo(uint32_t zoneId) const;
|
2026-02-17 05:27:03 -08:00
|
|
|
std::string getRandomMusic(uint32_t zoneId);
|
2026-02-11 18:25:04 -08:00
|
|
|
std::vector<std::string> getAllMusicPaths() const;
|
2026-02-02 12:24:50 -08:00
|
|
|
|
2026-02-17 16:26:49 -08:00
|
|
|
// When false, file: (original soundtrack) tracks are excluded from the pool
|
|
|
|
|
void setUseOriginalSoundtrack(bool use) { useOriginalSoundtrack_ = use; }
|
|
|
|
|
bool getUseOriginalSoundtrack() const { return useOriginalSoundtrack_; }
|
|
|
|
|
|
2026-02-02 12:24:50 -08:00
|
|
|
private:
|
|
|
|
|
// tile key = tileX * 100 + tileY
|
|
|
|
|
std::unordered_map<int, uint32_t> tileToZone;
|
|
|
|
|
std::unordered_map<uint32_t, ZoneInfo> zones;
|
2026-02-17 05:27:03 -08:00
|
|
|
std::string lastPlayedMusic_;
|
2026-02-17 16:26:49 -08:00
|
|
|
bool useOriginalSoundtrack_ = true;
|
2026-02-02 12:24:50 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace game
|
|
|
|
|
} // namespace wowee
|