Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
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
9
#include "
Platform/Singleton.h
"
10
#include <vector>
11
12
struct
WaypointData
13
{
14
uint32
id
;
15
float
x
,
y
,
z
,
orientation
;
16
uint32
delay
;
17
uint32
event_id
;
18
bool
run
;
19
uint8
event_chance
;
20
};
21
22
typedef
std::vector<WaypointData*>
WaypointPath
;
23
typedef
UNORDERED_MAP<uint32, WaypointPath>
WaypointPathContainer
;
24
25
class
WaypointMgr
26
{
27
friend
class
Skyfire::Singleton
<
WaypointMgr
,
Skyfire
::NullMutex>;
28
29
public
:
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
46
private
:
47
// Only allow instantiation from the singleton wrapper.
48
WaypointMgr
();
49
~WaypointMgr
();
50
51
WaypointPathContainer
_waypointStore
;
52
};
53
54
#define sWaypointMgr Skyfire::Singleton<WaypointMgr, Skyfire::NullMutex>::instance()
55
56
#endif
uint8
std::uint8_t uint8
Definition
Define.h:79
uint32
std::uint32_t uint32
Definition
Define.h:77
Singleton.h
UNORDERED_MAP
#define UNORDERED_MAP
Definition
UnorderedMap.h:58
WaypointPathContainer
UNORDERED_MAP< uint32, WaypointPath > WaypointPathContainer
Definition
WaypointManager.h:23
WaypointPath
std::vector< WaypointData * > WaypointPath
Definition
WaypointManager.h:22
Skyfire::Singleton
Definition
Singleton.h:15
WaypointMgr::WaypointMgr
WaypointMgr()
Definition
WaypointManager.cpp:12
WaypointMgr::Load
void Load()
Definition
WaypointManager.cpp:27
WaypointMgr::~WaypointMgr
~WaypointMgr()
Definition
WaypointManager.cpp:14
WaypointMgr::GetPath
WaypointPath const * GetPath(uint32 id) const
Definition
WaypointManager.h:37
WaypointMgr::ReloadPath
void ReloadPath(uint32 id)
Definition
WaypointManager.cpp:75
WaypointMgr::_waypointStore
WaypointPathContainer _waypointStore
Definition
WaypointManager.h:51
Skyfire
Definition
AuthPatchTransfer.h:12
WaypointData
Definition
WaypointManager.h:13
WaypointData::z
float z
Definition
WaypointManager.h:15
WaypointData::event_id
uint32 event_id
Definition
WaypointManager.h:17
WaypointData::x
float x
Definition
WaypointManager.h:15
WaypointData::run
bool run
Definition
WaypointManager.h:18
WaypointData::y
float y
Definition
WaypointManager.h:15
WaypointData::orientation
float orientation
Definition
WaypointManager.h:15
WaypointData::delay
uint32 delay
Definition
WaypointManager.h:16
WaypointData::event_chance
uint8 event_chance
Definition
WaypointManager.h:19
WaypointData::id
uint32 id
Definition
WaypointManager.h:14
src
server
game
Movement
Waypoints
WaypointManager.h
Generated on
for Project SkyFire Core by
1.17.0