TrinityCore
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<Player, std::vector<TaxiPathNodeEntry const*>>
34{
35 public:
37
39 bool GetResetPosition(Unit* owner, float& x, float& y, float& z) override;
40
41 void DoInitialize(Player*);
42 void DoReset(Player*);
43 bool DoUpdate(Player*, uint32);
44 void DoDeactivate(Player*);
45 void DoFinalize(Player*, bool, bool);
46
47 std::vector<TaxiPathNodeEntry const*> const& GetPath() { return _path; }
48 uint32 GetPathAtMapEnd() const;
49 bool HasArrived() const { return _currentNode >= _path.size(); }
50 uint32 GetPathId(size_t index) const;
51
52 void LoadPath(Player* owner, uint32 startNode = 0); // called from MotionMaster
55 void DoEventIfAny(Player* owner, TaxiPathNodeEntry const* node, bool departure);
56 void InitEndGridInfo();
57 void PreloadEndGrid(Player* owner);
58
59 std::string GetDebugInfo() const override;
60
61 private:
62 float _endGridX;
63 float _endGridY;
66
68 {
71 };
72 std::deque<TaxiNodeChangeInfo> _pointsForPathSwitch;
73};
74
75#endif // TRINITY_FLIGHTPATHMOVEMENTGENERATOR_H
int64_t int64
Definition: Define.h:137
uint32_t uint32
Definition: Define.h:142
MovementGeneratorType
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:627