TrinityCore
WaypointDefines.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITY_WAYPOINTDEFINES_H
19#define TRINITY_WAYPOINTDEFINES_H
20
21#include "Define.h"
22#include "EnumFlag.h"
23#include "Optional.h"
24#include <vector>
25
26#define WAYPOINT_PATH_FLAG_FOLLOW_PATH_BACKWARDS_MINIMUM_NODES 2
27
29{
30 Walk = 0,
31 Run = 1,
32 Land = 2,
33 TakeOff = 3,
34
35 Max
36};
37
39{
40 None = 0x00,
42};
43
45
47{
48 WaypointNode() : Id(0), X(0.f), Y(0.f), Z(0.f), Delay(0), MoveType(WaypointMoveType::Walk) { }
49 WaypointNode(uint32 id, float x, float y, float z, Optional<float> orientation = { }, uint32 delay = 0)
50 {
51 Id = id;
52 X = x;
53 Y = y;
54 Z = z;
55 Orientation = orientation;
56 Delay = delay;
58 }
59
61 float X;
62 float Y;
63 float Z;
67};
68
70{
71 WaypointPath() = default;
73 {
74 Id = id;
75 Nodes = std::move(nodes);
76 Flags = flags;
77 MoveType = moveType;
78 }
79
80 std::vector<WaypointNode> Nodes;
84};
85
86#endif
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
uint16 flags
Definition: DisableMgr.cpp:49
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
DEFINE_ENUM_FLAG(WaypointPathFlags)
WaypointMoveType
WaypointPathFlags
@ FollowPathBackwardsFromEndToStart
WaypointNode(uint32 id, float x, float y, float z, Optional< float > orientation={ }, uint32 delay=0)
Optional< float > Orientation
WaypointMoveType MoveType
std::vector< WaypointNode > Nodes
WaypointPath()=default
EnumFlag< WaypointPathFlags > Flags
WaypointPath(uint32 id, std::vector< WaypointNode > &&nodes, WaypointMoveType moveType=WaypointMoveType::Walk, WaypointPathFlags flags=WaypointPathFlags::None)
WaypointMoveType MoveType