2022-10-28 16:54:33 +02:00
|
|
|
#pragma once
|
|
|
|
#include "handling_profile.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
2022-12-17 15:11:36 +01:00
|
|
|
using handling_profiles = std::map<std::string, handling_profile>;
|
2022-10-28 16:54:33 +02:00
|
|
|
class handling_service final
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
handling_service();
|
|
|
|
~handling_service();
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
handling_service(const handling_service&) = delete;
|
|
|
|
handling_service(handling_service&&) noexcept = delete;
|
|
|
|
handling_service& operator=(const handling_service&) = delete;
|
2022-10-28 16:54:33 +02:00
|
|
|
handling_service& operator=(handling_service&&) noexcept = delete;
|
|
|
|
|
|
|
|
std::size_t load_files();
|
|
|
|
handling_profiles& profiles();
|
|
|
|
|
|
|
|
handling_profile* active_profile();
|
|
|
|
void apply_profile(handling_profile* profile);
|
|
|
|
bool save_profile(std::string name);
|
|
|
|
|
|
|
|
bool backup_vehicle();
|
|
|
|
void restore_vehicle() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const folder m_profiles_folder;
|
|
|
|
|
|
|
|
handling_profile* m_active_profile;
|
|
|
|
handling_profiles m_handling_profiles;
|
|
|
|
|
|
|
|
// contains the handling profiles of a vehicles before they're been modified
|
2023-07-20 22:46:32 +02:00
|
|
|
std::unordered_map<uint32_t, handling_profile> m_vehicle_backups;
|
2022-10-28 16:54:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
inline handling_service* g_handling_service{};
|
|
|
|
}
|