Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
WaypointManager.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SKYFIRE_WAYPOINTMANAGER_H
7#define SKYFIRE_WAYPOINTMANAGER_H
8
10#include <vector>
11
21
22typedef std::vector<WaypointData*> WaypointPath;
24
26{
27 friend class Skyfire::Singleton<WaypointMgr, Skyfire::NullMutex>;
28
29public:
30 // Attempts to reload a single path from database
31 void ReloadPath(uint32 id);
32
33 // Loads all paths from database, should only run on startup
34 void Load();
35
36 // Returns the path from a given id
37 WaypointPath const* GetPath(uint32 id) const
38 {
39 WaypointPathContainer::const_iterator itr = _waypointStore.find(id);
40 if (itr != _waypointStore.end())
41 return &itr->second;
42
43 return NULL;
44 }
45
46private:
47 // Only allow instantiation from the singleton wrapper.
50
52};
53
54#define sWaypointMgr Skyfire::Singleton<WaypointMgr, Skyfire::NullMutex>::instance()
55
56#endif
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define UNORDERED_MAP
UNORDERED_MAP< uint32, WaypointPath > WaypointPathContainer
std::vector< WaypointData * > WaypointPath
WaypointPath const * GetPath(uint32 id) const
void ReloadPath(uint32 id)
WaypointPathContainer _waypointStore