/* * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published by the * Free Software Foundation; either version 3 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef _GAMEGRAVEYARD_H_ #define _GAMEGRAVEYARD_H_ #include "Common.h" #include "Player.h" #include "SharedDefines.h" #include #include 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 WGGraveyardContainer; typedef std::pair GraveyardMapBounds; typedef std::pair GraveyardMapBoundsNonConst; class Graveyard { public: static Graveyard* instance(); typedef std::unordered_map GraveyardContainer; GraveyardStruct const* GetGraveyard(uint32 ID) const; GraveyardStruct const* GetGraveyard(const std::string& name) const; GraveyardStruct const* GetDefaultGraveyard(TeamId teamId); GraveyardStruct const* GetClosestGraveyard(Player* player, TeamId teamId, bool nearCorpse = false); 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_