mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 08:46:09 +00:00
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
/*
|
|
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
|
*/
|
|
|
|
#ifndef _GAMEGRAVEYARD_H_
|
|
#define _GAMEGRAVEYARD_H_
|
|
|
|
#include "Common.h"
|
|
#include "SharedDefines.h"
|
|
#include <map>
|
|
#include <unordered_map>
|
|
|
|
struct GraveyardStruct
|
|
{
|
|
uint32 ID;
|
|
uint32 Map;
|
|
float x;
|
|
float y;
|
|
float z;
|
|
std::string name;
|
|
std::wstring wnameLow;
|
|
};
|
|
|
|
struct GraveyardData
|
|
{
|
|
uint32 safeLocId;
|
|
TeamId teamId;
|
|
};
|
|
|
|
typedef std::multimap<uint32, GraveyardData> WGGraveyardContainer;
|
|
typedef std::pair<WGGraveyardContainer::const_iterator, WGGraveyardContainer::const_iterator> GraveyardMapBounds;
|
|
typedef std::pair<WGGraveyardContainer::iterator, WGGraveyardContainer::iterator> GraveyardMapBoundsNonConst;
|
|
|
|
class Graveyard
|
|
{
|
|
public:
|
|
static Graveyard* instance();
|
|
|
|
typedef std::unordered_map<uint32, GraveyardStruct> GraveyardContainer;
|
|
|
|
GraveyardStruct const* GetGraveyard(uint32 ID) const;
|
|
GraveyardStruct const* GetGraveyard(const std::string& name) const;
|
|
GraveyardStruct const* GetDefaultGraveyard(TeamId teamId);
|
|
GraveyardStruct const* GetClosestGraveyard(float x, float y, float z, uint32 MapId, TeamId teamId);
|
|
GraveyardData const* FindGraveyardData(uint32 id, uint32 zone);
|
|
GraveyardContainer const& GetGraveyardData() const { return _graveyardStore; }
|
|
bool AddGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool persist = true);
|
|
void RemoveGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool persist = false);
|
|
void LoadGraveyardZones();
|
|
void LoadGraveyardFromDB();
|
|
|
|
private:
|
|
GraveyardContainer _graveyardStore;
|
|
|
|
// for wintergrasp only
|
|
WGGraveyardContainer GraveyardStore;
|
|
};
|
|
|
|
#define sGraveyard Graveyard::instance()
|
|
|
|
#endif // _GAMEGRAVEYARD_H_
|