18#ifndef __TRINITY_VEHICLE_H
19#define __TRINITY_VEHICLE_H
40 void Reset(
bool evading =
false);
41 void InstallAllAccessories(
bool evading);
42 void ApplyAllImmunities();
49 bool HasEmptySeat(
int8 seatId)
const;
50 Unit* GetPassenger(
int8 seatId)
const;
51 SeatMap::const_iterator GetNextEmptySeat(
int8 seatId,
bool next)
const;
53 uint8 GetAvailableSeatCount()
const;
55 bool AddPassenger(
Unit* passenger,
int8 seatId = -1);
58 void RelocatePassengers();
59 void RemoveAllPassengers();
60 bool IsVehicleInUse()
const;
61 bool IsControllableVehicle()
const;
67 void RemovePendingEventsForPassenger(
Unit* passenger);
87 SeatMap::iterator GetSeatIteratorForPassenger(
Unit* passenger);
88 void InitMovementInfoForBase();
94 GetBase()->GetPositionX(), GetBase()->GetPositionY(),
95 GetBase()->GetPositionZ(), GetBase()->GetOrientation());
102 GetBase()->GetPositionX(), GetBase()->GetPositionY(),
103 GetBase()->GetPositionZ(), GetBase()->GetOrientation());
107 void RemovePendingEventsForSeat(
int8 seatId);
109 bool HasPendingEventForSeat(
int8 seatId)
const;
129 void Abort(
uint64)
override;
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::string GetDebugInfo()
std::set< ObjectGuid > GuidSet
std::map< int8, VehicleSeat > SeatMap
virtual void CalculatePassengerPosition(float &x, float &y, float &z, float *o=nullptr) const =0
This method transforms supplied transport offsets into global coordinates.
virtual void CalculatePassengerOffset(float &x, float &y, float &z, float *o=nullptr) const =0
This method transforms supplied global coordinates into local offsets.
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
VehicleJoinEvent(Vehicle *v, Unit *u)
void EjectPassenger(Unit *passenger, Unit *controller)
Unit * GetBase() const
May be called from scripts.
VehicleEntry const * GetVehicleInfo() const
uint32 GetCreatureEntry() const
uint32 UsableSeatNum
Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags.
std::list< VehicleJoinEvent * > PendingJoinEventContainer
void CalculatePassengerPosition(float &x, float &y, float &z, float *o) const override
This method transforms supplied transport offsets into global coordinates.
uint32 _creatureEntry
Can be different than the entry of _me in case of players.
Status _status
Internal variable for sanity checks.
Unit * _me
The underlying unit with the vehicle kit. Can be player or creature.
PendingJoinEventContainer _pendingJoinEvents
Collection of delayed join events for prospective passengers.
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
VehicleEntry const * _vehicleInfo
DBC data for vehicle.
void CalculatePassengerOffset(float &x, float &y, float &z, float *o) const override
This method transforms supplied global coordinates into local offsets.