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 "DBCStructure.h"
22#include "MovementGenerator.h"
23#include "PathMovementBase.h"
24#include <deque>
25
26class Player;
27
32class FlightPathMovementGenerator : public MovementGeneratorMedium<Player, FlightPathMovementGenerator>, public PathMovementBase<Player, TaxiPathNodeList>
33{
34 public:
35 explicit FlightPathMovementGenerator(uint32 startNode = 0);
36
38 bool GetResetPosition(Unit* owner, float& x, float& y, float& z) override;
39
40 bool DoInitialize(Player*);
41 bool DoReset(Player*);
42 bool DoUpdate(Player*, uint32);
43 void DoDeactivate(Player*);
44 void DoFinalize(Player*, bool, bool);
45
46 TaxiPathNodeList const& GetPath() { return _path; }
47 uint32 GetPathAtMapEnd() const;
48 bool HasArrived() const { return _currentNode >= _path.size(); }
49 uint32 GetPathId(size_t index) const;
50
51 void LoadPath(Player* owner); // called from MotionMaster
54 void DoEventIfAny(Player* owner, TaxiPathNodeEntry const* node, bool departure);
55 void InitEndGridInfo();
56 void PreloadEndGrid();
57
58 std::string GetDebugInfo() const override;
59
60 private:
61 float _endGridX;
62 float _endGridY;
65
71 std::deque<TaxiNodeChangeInfo> _pointsForPathSwitch;
72};
73
74#endif // TRINITY_FLIGHTPATHMOVEMENTGENERATOR_H
std::vector< TaxiPathNodeEntry const * > TaxiPathNodeList
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
MovementGeneratorType
float _endGridY
X coord of last node location.
bool GetResetPosition(Unit *owner, float &x, float &y, float &z) override
uint32 _preloadTargetNode
map Id of last node location
std::string GetDebugInfo() const override
void DoEventIfAny(Player *owner, TaxiPathNodeEntry const *node, bool departure)
MovementGeneratorType GetMovementGeneratorType() const override
std::deque< TaxiNodeChangeInfo > _pointsForPathSwitch
uint32 _endMapId
Y coord of last node location.
Definition Unit.h:769