TrinityCore
Loading...
Searching...
No Matches
FlightPathMovementGenerator.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_FLIGHTPATHMOVEMENTGENERATOR_H
19#define TRINITY_FLIGHTPATHMOVEMENTGENERATOR_H
20
21#include "MovementGenerator.h"
22#include "PathMovementBase.h"
23#include <deque>
24#include <vector>
25
26class Player;
28
33class FlightPathMovementGenerator : public MovementGeneratorMedium<Player, FlightPathMovementGenerator>, public PathMovementBase<std::vector<TaxiPathNodeEntry const*>>
34{
35 public:
38
40 bool GetResetPosition(Unit* owner, float& x, float& y, float& z) override;
41
42 void DoInitialize(Player*);
43 void DoReset(Player*);
44 bool DoUpdate(Player*, uint32);
45 void DoDeactivate(Player*);
46 void DoFinalize(Player*, bool, bool);
47
48 std::vector<TaxiPathNodeEntry const*> const& GetPath() { return _path; }
49 uint32 GetPathAtMapEnd() const;
50 bool HasArrived() const { return _currentNode >= _path.size(); }
51 uint32 GetPathId(size_t index) const;
52
53 void LoadPath(Player* owner, uint32 startNode = 0); // called from MotionMaster
56 void DoEventIfAny(Player* owner, TaxiPathNodeEntry const* node, bool departure);
57 void InitEndGridInfo();
58 void PreloadEndGrid(Player* owner);
59
60 std::string GetDebugInfo() const override;
61
62 private:
64 float _endGridX;
65 float _endGridY;
68
74 std::deque<TaxiNodeChangeInfo> _pointsForPathSwitch;
75};
76
77#endif // TRINITY_FLIGHTPATHMOVEMENTGENERATOR_H
int64_t int64
Definition Define.h:149
uint32_t uint32
Definition Define.h:154
MovementGeneratorType
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
float _endGridY
Y coord of last node location.
bool GetResetPosition(Unit *owner, float &x, float &y, float &z) override
uint32 _preloadTargetNode
node index where preloading starts
std::string GetDebugInfo() const override
void DoEventIfAny(Player *owner, TaxiPathNodeEntry const *node, bool departure)
std::vector< TaxiPathNodeEntry const * > const & GetPath()
MovementGeneratorType GetMovementGeneratorType() const override
void LoadPath(Player *owner, uint32 startNode=0)
float _endGridX
X coord of last node location.
std::deque< TaxiNodeChangeInfo > _pointsForPathSwitch
node indexes and costs where TaxiPath changes
uint32 _endMapId
map Id of last node location
Definition Unit.h:635