18#ifndef __TRINITY_VEHICLE_H
19#define __TRINITY_VEHICLE_H
44 void Reset(
bool evading =
false);
45 void InstallAllAccessories(
bool evading);
46 void ApplyAllImmunities();
53 bool HasEmptySeat(
int8 seatId)
const;
54 Unit* GetPassenger(
int8 seatId)
const;
55 SeatMap::const_iterator GetNextEmptySeat(
int8 seatId,
bool next)
const;
57 uint8 GetAvailableSeatCount()
const;
59 bool AddVehiclePassenger(
Unit* unit,
int8 seatId = -1);
61 void RelocatePassengers();
62 void RemoveAllPassengers();
63 bool IsVehicleInUse()
const;
64 bool IsControllableVehicle()
const;
66 SeatMap::iterator GetSeatIteratorForPassenger(
Unit* passenger);
71 void RemovePendingEventsForPassenger(
Unit* passenger);
91 void InitMovementInfoForBase();
103 GetBase()->GetPositionX(), GetBase()->GetPositionY(),
104 GetBase()->GetPositionZ(), GetBase()->GetOrientation());
111 GetBase()->GetPositionX(), GetBase()->GetPositionY(),
112 GetBase()->GetPositionZ(), GetBase()->GetOrientation());
118 void RemovePendingEventsForSeat(
int8 seatId);
120 bool HasPendingEventForSeat(
int8 seatId)
const;
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 TransportBase * RemovePassenger(WorldObject *passenger)=0
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)
Vehicle(Vehicle &&right)=delete
float GetTransportOrientation() const override
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.
Vehicle & operator=(Vehicle const &right)=delete
uint32 _creatureEntry
Can be different than the entry of _me in case of players.
Status _status
Internal variable for sanity checks.
Vehicle(Vehicle const &right)=delete
Unit * _me
The underlying unit with the vehicle kit. Can be player or creature.
PendingJoinEventContainer _pendingJoinEvents
Collection of delayed join events for prospective passengers.
void AddPassenger(WorldObject *) override
Attempts to add a passenger to the vehicle on 'seatId'.
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
Vehicle & operator=(Vehicle &&right)=delete
ObjectGuid GetTransportGUID() const override
int32 GetMapIdForSpawning() const override
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.
void Abort(char const *file, int line, char const *function)