diff options
-rw-r--r-- | src/server/game/Entities/Vehicle/Vehicle.h | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index e1263a8e661..40aea1a2d02 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -27,11 +27,19 @@ struct VehicleEntry; class Unit; -typedef std::set<uint64> GuidSet; class VehicleJoinEvent; +typedef std::set<uint64> GuidSet; + class Vehicle : public TransportBase { + protected: + friend bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry); + Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry); + + friend void Unit::RemoveVehicleKit(); + ~Vehicle(); + public: void Install(); void Uninstall(); @@ -61,19 +69,13 @@ class Vehicle : public TransportBase void SetLastShootPos(Position const& pos) { m_lastShootPos.Relocate(pos); } Position GetLastShootPos() { return m_lastShootPos; } - SeatMap Seats; ///< The collection of all seats on the vehicle. Including vacant ones. + SeatMap Seats; ///< The collection of all seats on the vehicle. Including vacant ones. VehicleSeatEntry const* GetSeatForPassenger(Unit* passenger); protected: friend class VehicleJoinEvent; - uint32 UsableSeatNum; ///< Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags - - protected: - friend bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry); - Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry); - friend void Unit::RemoveVehicleKit(); - ~Vehicle(); + uint32 UsableSeatNum; ///< Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags private: enum Status @@ -92,12 +94,12 @@ class Vehicle : public TransportBase /// This method transforms supplied global coordinates into local offsets void CalculatePassengerOffset(float& x, float& y, float& z, float& o); - Unit* _me; ///< The underlying unit with the vehicle kit. Can be player or creature. - VehicleEntry const* _vehicleInfo; ///< DBC data for vehicle + 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 + uint32 _creatureEntry; ///< Can be different than the entry of _me in case of players + Status _status; ///< Internal variable for sanity checks Position m_lastShootPos; std::deque<VehicleJoinEvent*> _pendingJoinEvents; ///< Collection of delayed join events for prospective passengers void CancelJoinEvent(VehicleJoinEvent* e); @@ -117,4 +119,5 @@ class VehicleJoinEvent : public BasicEvent Unit* Passenger; SeatMap::iterator Seat; }; + #endif |