![]() |
TrinityCore
|
#include <FlightPathMovementGenerator.h>
Inheritance diagram for FlightPathMovementGenerator:Classes | |
| struct | TaxiNodeChangeInfo |
Public Member Functions | |
| FlightPathMovementGenerator (Optional< float > speed, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult) | |
| MovementGeneratorType | GetMovementGeneratorType () const override |
| bool | GetResetPosition (Unit *owner, float &x, float &y, float &z) override |
| bool | DoInitialize (Player *) |
| bool | DoReset (Player *) |
| bool | DoUpdate (Player *, uint32) |
| void | DoDeactivate (Player *) |
| void | DoFinalize (Player *, bool, bool) |
| std::vector< TaxiPathNodeEntry const * > const & | GetPath () |
| uint32 | GetPathAtMapEnd () const |
| bool | HasArrived () const |
| uint32 | GetPathId (size_t index) const |
| void | LoadPath (Player *owner, uint32 startNode=0) |
| void | SetCurrentNodeAfterTeleport () |
| void | SkipCurrentNode () |
| void | DoEventIfAny (Player *owner, TaxiPathNodeEntry const *node, bool departure) |
| void | InitEndGridInfo () |
| void | PreloadEndGrid (Player *owner) |
| std::string | GetDebugInfo () const override |
Public Member Functions inherited from MovementGeneratorMedium< Player, FlightPathMovementGenerator > | |
| bool | Initialize (Unit *owner) override |
| bool | Reset (Unit *owner) override |
| bool | Update (Unit *owner, uint32 diff) override |
| void | Deactivate (Unit *owner) override |
| void | Finalize (Unit *owner, bool active, bool movementInform) override |
Public Member Functions inherited from MovementGenerator | |
| MovementGenerator () | |
| MovementGenerator (MovementGenerator const &)=delete | |
| MovementGenerator (MovementGenerator &&)=delete | |
| MovementGenerator & | operator= (MovementGenerator const &)=delete |
| MovementGenerator & | operator= (MovementGenerator &&)=delete |
| virtual | ~MovementGenerator () |
| virtual void | UnitSpeedChanged () |
| virtual void | Pause (uint32) |
| virtual void | Resume (uint32) |
| void | AddFlag (uint16 const flag) |
| bool | HasFlag (uint16 const flag) const |
| void | RemoveFlag (uint16 const flag) |
Public Member Functions inherited from PathMovementBase< BasePath > | |
| PathMovementBase () | |
| PathMovementBase (PathType &&path) | |
| virtual | ~PathMovementBase ()=default |
| uint32 | GetCurrentNode () const |
Private Attributes | |
| Optional< float > | _speed |
| float | _endGridX |
| X coord of last node location. | |
| float | _endGridY |
| Y coord of last node location. | |
| uint32 | _endMapId |
| map Id of last node location | |
| uint32 | _preloadTargetNode |
| node index where preloading starts | |
| std::deque< TaxiNodeChangeInfo > | _pointsForPathSwitch |
| node indexes and costs where TaxiPath changes | |
Additional Inherited Members | |
Public Types inherited from PathMovementBase< BasePath > | |
| using | PathType = BasePath |
Public Attributes inherited from MovementGenerator | |
| uint8 | Priority |
| uint16 | Flags |
| uint32 | BaseUnitState |
| Scripting::v2::ActionResultSetter< MovementStopReason > | ScriptResult |
Protected Member Functions inherited from MovementGenerator | |
| void | SetScriptResult (MovementStopReason reason) |
Protected Attributes inherited from PathMovementBase< BasePath > | |
| PathType | _path |
| uint32 | _currentNode |
FlightPathMovementGenerator generates movement of the player for the paths and hence generates ground and activities for the player.
Definition at line 33 of file FlightPathMovementGenerator.h.
|
explicit |
Definition at line 35 of file FlightPathMovementGenerator.cpp.
References _endGridX, _endGridY, _endMapId, _preloadTargetNode, _speed, MovementGenerator::BaseUnitState, MovementGenerator::Flags, MOTION_PRIORITY_HIGHEST, MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING, MovementGenerator::Priority, MovementGenerator::ScriptResult, and UNIT_STATE_IN_FLIGHT.
| void FlightPathMovementGenerator::DoDeactivate | ( | Player * | ) |
Definition at line 152 of file FlightPathMovementGenerator.cpp.
References MovementGenerator::AddFlag(), and MOVEMENTGENERATOR_FLAG_DEACTIVATED.
| void FlightPathMovementGenerator::DoEventIfAny | ( | Player * | owner, |
| TaxiPathNodeEntry const * | node, | ||
| bool | departure | ||
| ) |
Definition at line 274 of file FlightPathMovementGenerator.cpp.
References TaxiPathNodeEntry::ArrivalEventID, ASSERT, TaxiPathNodeEntry::DepartureEventID, Player::GetDebugInfo(), WorldObject::GetName(), TaxiPathNodeEntry::NodeIndex, TaxiPathNodeEntry::PathID, TC_LOG_DEBUG, and GameEvents::Trigger().
Referenced by DoUpdate().
| void FlightPathMovementGenerator::DoFinalize | ( | Player * | owner, |
| bool | active, | ||
| bool | movementInform | ||
| ) |
Definition at line 157 of file FlightPathMovementGenerator.cpp.
References PathMovementBase< BasePath >::_path, MovementGenerator::AddFlag(), PlayerTaxi::ClearTaxiDestinations(), Unit::Dismount(), Finished, Position::GetOrientation(), Player::m_taxi, MOVEMENTGENERATOR_FLAG_FINALIZED, PLAYER_FLAGS_TAXI_BENCHMARK, Player::RemovePlayerFlag(), Unit::RemoveUnitFlag(), Player::SetFallInformation(), MovementGenerator::SetScriptResult(), sTaxiNodesStore, sTaxiPathStore, Unit::StopMoving(), TAXI_PATH_NODE_FLAG_TELEPORT, Player::TeleportTo(), TaxiPathEntry::ToTaxiNode, UNIT_FLAG_ON_TAXI, and UNIT_FLAG_REMOVE_CLIENT_CONTROL.
| bool FlightPathMovementGenerator::DoInitialize | ( | Player * | owner | ) |
Definition at line 64 of file FlightPathMovementGenerator.cpp.
References MovementGenerator::AddFlag(), DoReset(), InitEndGridInfo(), MOVEMENTGENERATOR_FLAG_DEACTIVATED, MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING, MOVEMENTGENERATOR_FLAG_INITIALIZED, and MovementGenerator::RemoveFlag().
| bool FlightPathMovementGenerator::DoReset | ( | Player * | owner | ) |
Definition at line 74 of file FlightPathMovementGenerator.cpp.
References PathMovementBase< BasePath >::_path, _speed, Unit::CombatStopWithPets(), PathMovementBase< BasePath >::GetCurrentNode(), Player::GetDebugInfo(), GetPathAtMapEnd(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Movement::MoveSplineInit::Launch(), MOVEMENTGENERATOR_FLAG_DEACTIVATED, Movement::MoveSplineInit::Path(), PLAYER_FLIGHT_SPEED, MovementGenerator::RemoveFlag(), Movement::MoveSplineInit::SetFirstPointId(), Movement::MoveSplineInit::SetFly(), Movement::MoveSplineInit::SetSmooth(), Movement::MoveSplineInit::SetUncompressed(), Unit::SetUnitFlag(), Movement::MoveSplineInit::SetVelocity(), Movement::MoveSplineInit::SetWalk(), TC_LOG_DEBUG, UNIT_FLAG_ON_TAXI, and UNIT_FLAG_REMOVE_CLIENT_CONTROL.
Referenced by DoInitialize().
Definition at line 107 of file FlightPathMovementGenerator.cpp.
References PathMovementBase< BasePath >::_currentNode, PathMovementBase< BasePath >::_path, _pointsForPathSwitch, _preloadTargetNode, MovementGenerator::AddFlag(), ASSERT, DoEventIfAny(), Player::GetDebugInfo(), Player::m_taxi, Player::ModifyMoney(), MoneySpentOnTaxis, MOVEMENTGENERATOR_FLAG_INFORM_ENABLED, Unit::movespline, PlayerTaxi::NextTaxiDestination(), PreloadEndGrid(), and Player::UpdateCriteria().
|
overridevirtual |
Reimplemented from MovementGenerator.
Definition at line 329 of file FlightPathMovementGenerator.cpp.
References _endGridX, _endGridY, _endMapId, PathMovementBase< BasePath >::_path, _preloadTargetNode, MovementGenerator::GetDebugInfo(), PathMovementBase< BasePath >::GetDebugInfo(), GetPathId(), and HasArrived().
|
overridevirtual |
Implements MovementGenerator.
Definition at line 50 of file FlightPathMovementGenerator.cpp.
References FLIGHT_MOTION_TYPE.
|
inline |
Definition at line 48 of file FlightPathMovementGenerator.h.
References PathMovementBase< BasePath >::_path.
| uint32 FlightPathMovementGenerator::GetPathAtMapEnd | ( | ) | const |
Definition at line 189 of file FlightPathMovementGenerator.cpp.
References PathMovementBase< BasePath >::_currentNode, PathMovementBase< BasePath >::_path, MovementGenerator::Flags, and TAXI_PATH_NODE_FLAG_TELEPORT.
Referenced by DoReset().
| uint32 FlightPathMovementGenerator::GetPathId | ( | size_t | index | ) | const |
Definition at line 321 of file FlightPathMovementGenerator.cpp.
References PathMovementBase< BasePath >::_path.
Referenced by GetDebugInfo().
|
overridevirtual |
Reimplemented from MovementGenerator.
Definition at line 55 of file FlightPathMovementGenerator.cpp.
References PathMovementBase< BasePath >::_currentNode, PathMovementBase< BasePath >::_path, TaxiPathNodeEntry::Loc, DBCPosition3D::X, DBCPosition3D::Y, and DBCPosition3D::Z.
|
inline |
Definition at line 50 of file FlightPathMovementGenerator.h.
References PathMovementBase< BasePath >::_currentNode, and PathMovementBase< BasePath >::_path.
Referenced by GetDebugInfo().
| void FlightPathMovementGenerator::InitEndGridInfo | ( | ) |
Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will be reinitialized for each flightmaster at the end of each spline (or stop) in the flight.
Definition at line 285 of file FlightPathMovementGenerator.cpp.
References _endGridX, _endGridY, _endMapId, PathMovementBase< BasePath >::_path, _preloadTargetNode, and ASSERT.
Referenced by DoInitialize().
Definition at line 214 of file FlightPathMovementGenerator.cpp.
References PathMovementBase< BasePath >::_currentNode, PathMovementBase< BasePath >::_path, _pointsForPathSwitch, PlayerTaxi::GetFlightMasterFactionTemplate(), PlayerTaxi::GetPath(), Player::GetReputationPriceDiscount(), IsNodeIncludedInShortenedPath(), Player::m_taxi, sObjectMgr, sTaxiPathNodesByPath, and TAXI_PATH_NODE_FLAG_TELEPORT.
Referenced by MotionMaster::MoveTaxiFlight().
| void FlightPathMovementGenerator::PreloadEndGrid | ( | Player * | owner | ) |
Definition at line 306 of file FlightPathMovementGenerator.cpp.
References _endGridX, _endGridY, _endMapId, PathMovementBase< BasePath >::_path, _preloadTargetNode, WorldObject::GetMap(), Map::LoadGrid(), and TC_LOG_DEBUG.
Referenced by DoUpdate().
| void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport | ( | ) |
Definition at line 258 of file FlightPathMovementGenerator.cpp.
References PathMovementBase< BasePath >::_currentNode, PathMovementBase< BasePath >::_path, TaxiPathNodeEntry::ContinentID, MovementGenerator::Flags, and TAXI_PATH_NODE_FLAG_TELEPORT.
|
inline |
Definition at line 55 of file FlightPathMovementGenerator.h.
References PathMovementBase< BasePath >::_currentNode.
|
private |
X coord of last node location.
Definition at line 64 of file FlightPathMovementGenerator.h.
Referenced by FlightPathMovementGenerator(), GetDebugInfo(), InitEndGridInfo(), and PreloadEndGrid().
|
private |
Y coord of last node location.
Definition at line 65 of file FlightPathMovementGenerator.h.
Referenced by FlightPathMovementGenerator(), GetDebugInfo(), InitEndGridInfo(), and PreloadEndGrid().
|
private |
map Id of last node location
Definition at line 66 of file FlightPathMovementGenerator.h.
Referenced by FlightPathMovementGenerator(), GetDebugInfo(), InitEndGridInfo(), and PreloadEndGrid().
|
private |
node indexes and costs where TaxiPath changes
Definition at line 74 of file FlightPathMovementGenerator.h.
Referenced by DoUpdate(), and LoadPath().
|
private |
node index where preloading starts
Definition at line 67 of file FlightPathMovementGenerator.h.
Referenced by DoUpdate(), FlightPathMovementGenerator(), GetDebugInfo(), InitEndGridInfo(), and PreloadEndGrid().
|
private |
Definition at line 63 of file FlightPathMovementGenerator.h.
Referenced by DoReset(), and FlightPathMovementGenerator().