2022-01-08 05:42:36 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
class script_global;
|
|
|
|
|
2022-05-10 19:02:30 +02:00
|
|
|
class personal_vehicle final
|
2022-01-08 05:42:36 +01:00
|
|
|
{
|
|
|
|
std::string m_name;
|
|
|
|
int m_id;
|
|
|
|
Hash m_hash;
|
|
|
|
int* m_state_bitfield;
|
|
|
|
|
|
|
|
public:
|
2022-05-10 19:02:30 +02:00
|
|
|
personal_vehicle(int idx, script_global vehicle_idx);
|
2022-01-08 05:42:36 +01:00
|
|
|
|
2022-05-10 19:02:30 +02:00
|
|
|
[[nodiscard]] std::string get_display_name() const;
|
|
|
|
[[nodiscard]] Hash get_hash() const;
|
|
|
|
[[nodiscard]] int get_id() const;
|
2022-01-08 05:42:36 +01:00
|
|
|
|
2022-05-10 19:02:30 +02:00
|
|
|
void summon() const;
|
2022-01-08 05:42:36 +01:00
|
|
|
};
|
|
|
|
|
2022-05-10 19:02:30 +02:00
|
|
|
class mobile_service final
|
2022-01-08 05:42:36 +01:00
|
|
|
{
|
2022-05-10 19:02:30 +02:00
|
|
|
std::map<std::string, std::unique_ptr<personal_vehicle>> m_personal_vehicles;
|
|
|
|
std::map<int, std::string> m_pv_lookup;
|
|
|
|
|
|
|
|
std::chrono::time_point<std::chrono::steady_clock> m_last_update;
|
|
|
|
|
2022-01-08 05:42:36 +01:00
|
|
|
public:
|
|
|
|
mobile_service();
|
|
|
|
~mobile_service();
|
|
|
|
|
2022-05-10 19:02:30 +02:00
|
|
|
mobile_service(const mobile_service&) = delete;
|
|
|
|
mobile_service(mobile_service&&) noexcept = delete;
|
|
|
|
mobile_service& operator=(const mobile_service&) = delete;
|
|
|
|
mobile_service& operator=(mobile_service&&) noexcept = delete;
|
2022-01-08 05:42:36 +01:00
|
|
|
|
2022-05-10 19:02:30 +02:00
|
|
|
std::map<std::string, std::unique_ptr<personal_vehicle>>& personal_vehicles()
|
|
|
|
{ return m_personal_vehicles; }
|
|
|
|
void refresh_personal_vehicles();
|
|
|
|
void register_vehicles();
|
2022-01-08 05:42:36 +01:00
|
|
|
|
|
|
|
};
|
2022-05-10 19:02:30 +02:00
|
|
|
|
2022-01-08 05:42:36 +01:00
|
|
|
inline mobile_service* g_mobile_service{};
|
|
|
|
}
|