![]() |
TrinityCore
|
#include <Vehicle.h>
Inheritance diagram for Vehicle:Public Member Functions | |
| Vehicle (Unit *unit, VehicleEntry const *vehInfo, uint32 creatureEntry) | |
| ~Vehicle () | |
| Vehicle (Vehicle const &right)=delete | |
| Vehicle (Vehicle &&right)=delete | |
| Vehicle & | operator= (Vehicle const &right)=delete |
| Vehicle & | operator= (Vehicle &&right)=delete |
| void | Install () |
| Initializes power type for vehicle. Nothing more. | |
| void | Uninstall () |
| Removes all passengers and sets status to STATUS_UNINSTALLING. No new passengers can be added to the vehicle after this call. | |
| void | Reset (bool evading=false) |
| Reapplies immunities and reinstalls accessories. Only has effect for creatures. | |
| void | InstallAllAccessories (bool evading) |
| void | ApplyAllImmunities () |
| Applies specific immunities that cannot be set in DB. | |
| void | InstallAccessory (uint32 entry, int8 seatId, bool minion, uint8 type, uint32 summonTime, Optional< uint32 > rideSpellId={}) |
| Installs an accessory. | |
| Unit * | GetBase () const |
| VehicleEntry const * | GetVehicleInfo () const |
| uint32 | GetCreatureEntry () const |
| bool | HasEmptySeat (int8 seatId) const |
| Checks if vehicle's seat specified by 'seatId' is empty. | |
| Unit * | GetPassenger (int8 seatId) const |
| Gets a passenger on specified seat. | |
| SeatMap::const_iterator | GetNextEmptySeat (int8 seatId, bool next) const |
| Gets the next empty seat based on current seat. | |
| VehicleSeatAddon const * | GetSeatAddonForSeatOfPassenger (Unit const *passenger) const |
| Gets the vehicle seat addon data for the seat of a passenger. | |
| uint8 | GetAvailableSeatCount () const |
| Gets the available seat count. | |
| bool | AddVehiclePassenger (Unit *unit, int8 seatId=-1) |
| Vehicle * | RemovePassenger (WorldObject *passenger) override |
| Removes the passenger from the vehicle. | |
| void | RelocatePassengers () |
| Relocate passengers. Must be called after m_base::Relocate. | |
| void | RemoveAllPassengers () |
| Removes all current and pending passengers from the vehicle. | |
| bool | IsVehicleInUse () const |
| Returns information whether the vehicle is currently used by any unit. | |
| bool | IsControllableVehicle () const |
| SeatMap::iterator | GetSeatIteratorForPassenger (Unit *passenger) |
| Gets seat iterator for specified passenger. | |
| VehicleSeatEntry const * | GetSeatForPassenger (Unit const *passenger) const |
| Returns information on the seat of specified passenger, represented by the format in VehicleSeat.dbc. | |
| void | RemovePendingEventsForPassenger (Unit *passenger) |
| Milliseconds | GetDespawnDelay () |
| float | GetPitch () |
| std::string | GetDebugInfo () const |
| Trinity::unique_weak_ptr< Vehicle > | GetWeakPtr () const |
Public Member Functions inherited from TransportBase | |
| void | UpdatePassengerPosition (Map *map, WorldObject *passenger, Position const &position, bool setHomePosition) |
Public Attributes | |
| SeatMap | Seats |
| The collection of all seats on the vehicle. Including vacant ones. | |
Protected Attributes | |
| uint32 | UsableSeatNum |
| Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags. | |
Private Types | |
| enum | Status { STATUS_NONE , STATUS_INSTALLED , STATUS_UNINSTALLING } |
| typedef std::list< VehicleJoinEvent * > | PendingJoinEventContainer |
Private Member Functions | |
| void | InitMovementInfoForBase () |
| Sets correct MovementFlags2 based on VehicleFlags from DBC. | |
| ObjectGuid | GetTransportGUID () const override |
| float | GetTransportOrientation () const override |
| void | AddPassenger (WorldObject *, Position const &) override |
| Attempts to add a passenger to the vehicle on 'seatId'. | |
| Position | GetPositionWithOffset (Position const &offset) const override |
| This method transforms supplied transport offsets into global coordinates. | |
| Position | GetPositionOffsetTo (Position const &endPos) const override |
| This method transforms supplied global coordinates into local offsets. | |
| int32 | GetMapIdForSpawning () const override |
| void | RemovePendingEvent (VehicleJoinEvent *e) |
| Removes @VehicleJoinEvent objects from pending join event store. This method only removes it after it's executed or aborted to prevent leaving pointers to deleted events. | |
| void | RemovePendingEventsForSeat (int8 seatId) |
| Removes any pending events for given seatId. Executed when a @VehicleJoinEvent::Execute is called. | |
| bool | HasPendingEventForSeat (int8 seatId) const |
Private Attributes | |
| Unit * | _me |
| The underlying unit with the vehicle kit. Can be player or creature. | |
| VehicleEntry const * | _vehicleInfo |
| DBC data for vehicle. | |
| GuidSet | vehiclePlayers |
| uint32 | _creatureEntry |
| Can be different than the entry of _me in case of players. | |
| Status | _status |
| Internal variable for sanity checks. | |
| PendingJoinEventContainer | _pendingJoinEvents |
| Collection of delayed join events for prospective passengers. | |
Friends | |
| class | VehicleJoinEvent |
Additional Inherited Members | |
Protected Member Functions inherited from TransportBase | |
| TransportBase () | |
| virtual | ~TransportBase () |
|
private |
|
private |
| Vehicle::Vehicle | ( | Unit * | unit, |
| VehicleEntry const * | vehInfo, | ||
| uint32 | creatureEntry | ||
| ) |
| Vehicle::~Vehicle | ( | ) |
@Uninstall must be called before this.
Definition at line 73 of file Vehicle.cpp.
|
delete |
|
delete |
|
inlineoverrideprivatevirtual |
Attempts to add a passenger to the vehicle on 'seatId'.
| unit | The prospective passenger. |
| seatId | Identifier for the seat. Value of -1 indicates the next available seat. |
Implements TransportBase.
@Prevent adding passengers when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
Definition at line 442 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void Vehicle::ApplyAllImmunities | ( | ) |
Applies specific immunities that cannot be set in DB.
Definition at line 173 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| uint8 Vehicle::GetAvailableSeatCount | ( | ) | const |
Gets the available seat count.
Definition at line 712 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
|
inline |
| std::string Vehicle::GetDebugInfo | ( | ) | const |
| Milliseconds Vehicle::GetDespawnDelay | ( | ) |
|
inlineoverrideprivatevirtual |
Implements TransportBase.
| SeatMap::const_iterator Vehicle::GetNextEmptySeat | ( | int8 | seatId, |
| bool | next | ||
| ) | const |
Gets the next empty seat based on current seat.
| seatId | Identifier for the current seat. |
| next | true if iterating forward, false means iterating backwards. |
Definition at line 326 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Gets a passenger on specified seat.
| seatId | Seat to look on. |
Definition at line 303 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| float Vehicle::GetPitch | ( | ) |
This method transforms supplied global coordinates into local offsets.
Implements TransportBase.
Definition at line 104 of file Vehicle.h.
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
This method transforms supplied transport offsets into global coordinates.
Implements TransportBase.
Definition at line 101 of file Vehicle.h.
Here is the call graph for this function:| VehicleSeatAddon const * Vehicle::GetSeatAddonForSeatOfPassenger | ( | Unit const * | passenger | ) | const |
Gets the vehicle seat addon data for the seat of a passenger.
| passenger | Identifier for the current seat user |
Definition at line 370 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| VehicleSeatEntry const * Vehicle::GetSeatForPassenger | ( | Unit const * | passenger | ) | const |
Returns information on the seat of specified passenger, represented by the format in VehicleSeat.dbc.
| [in,out] | The | passenger for which we check the seat info. |
Definition at line 670 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| SeatMap::iterator Vehicle::GetSeatIteratorForPassenger | ( | Unit * | passenger | ) |
Gets seat iterator for specified passenger.
| [in,out] | passenger | Passenger to look up. |
Definition at line 692 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineoverrideprivatevirtual |
Implements TransportBase.
|
inlineoverrideprivatevirtual |
Implements TransportBase.
|
inline |
| Trinity::unique_weak_ptr< Vehicle > Vehicle::GetWeakPtr | ( | ) | const |
| bool Vehicle::HasEmptySeat | ( | int8 | seatId | ) | const |
Checks if vehicle's seat specified by 'seatId' is empty.
| seatId | Identifier for the seat. |
Definition at line 282 of file Vehicle.cpp.
Here is the caller graph for this function:
|
private |
|
private |
Sets correct MovementFlags2 based on VehicleFlags from DBC.
Definition at line 639 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void Vehicle::Install | ( | ) |
Initializes power type for vehicle. Nothing more.
Definition at line 90 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void Vehicle::InstallAccessory | ( | uint32 | entry, |
| int8 | seatId, | ||
| bool | minion, | ||
| uint8 | type, | ||
| uint32 | summonTime, | ||
| Optional< uint32 > | rideSpellId = {} |
||
| ) |
Installs an accessory.
| entry | The NPC entry of accessory. |
| seatId | Identifier for the seat to add the accessory to. |
| minion | true if accessory considered a 'minion'. Implies that the accessory will despawn when the vehicle despawns. Essentially that it has no life without the vehicle. Their fates are bound. |
| type | See enum @SummonType. |
| summonTime | Time after which the minion is despawned in case of a timed despawn @type specified. |
@Prevent adding accessories when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
If for some reason adding accessory to vehicle fails it will unsummon in @VehicleJoinEvent::Abort
Definition at line 396 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void Vehicle::InstallAllAccessories | ( | bool | evading | ) |
Definition at line 97 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool Vehicle::IsControllableVehicle | ( | ) | const |
| bool Vehicle::IsVehicleInUse | ( | ) | const |
Returns information whether the vehicle is currently used by any unit.
Definition at line 612 of file Vehicle.cpp.
Here is the caller graph for this function:| void Vehicle::RelocatePassengers | ( | ) |
Relocate passengers. Must be called after m_base::Relocate.
Definition at line 579 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void Vehicle::RemoveAllPassengers | ( | ) |
Removes all current and pending passengers from the vehicle.
Setting to_Abort to true will cause @VehicleJoinEvent::Abort to be executed on next @Unit::UpdateEvents call This will properly "reset" the pending join process for the passenger.
Update vehicle pointer in every pending join event - Abort may be called after vehicle is deleted
Definition at line 238 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Removes the passenger from the vehicle.
| [in,out] | unit | The passenger to remove. |
Implements TransportBase.
Definition at line 513 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Removes @VehicleJoinEvent objects from pending join event store. This method only removes it after it's executed or aborted to prevent leaving pointers to deleted events.
| [in] | e | The VehicleJoinEvent* to remove from pending event store. |
Definition at line 736 of file Vehicle.cpp.
Here is the caller graph for this function:| void Vehicle::RemovePendingEventsForPassenger | ( | Unit * | passenger | ) |
|
private |
Removes any pending events for given seatId. Executed when a @VehicleJoinEvent::Execute is called.
Removes any pending events for given passenger. Executed when vehicle control aura is removed while adding passenger is in progress.
| seatId | Identifier for the seat. |
| passenger | Unit that is supposed to enter the vehicle. |
Definition at line 759 of file Vehicle.cpp.
Here is the caller graph for this function:| void Vehicle::Reset | ( | bool | evading = false | ) |
Reapplies immunities and reinstalls accessories. Only has effect for creatures.
| evading | true if called from CreatureAI::EnterEvadeMode |
Definition at line 150 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void Vehicle::Uninstall | ( | ) |
Removes all passengers and sets status to STATUS_UNINSTALLING. No new passengers can be added to the vehicle after this call.
@Prevent recursive uninstall call. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
Definition at line 121 of file Vehicle.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
| SeatMap Vehicle::Seats |
|
protected |