2024-02-25 14:46:47 +00:00
|
|
|
#pragma once
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
#include "StarJson.hpp"
|
|
|
|
#include "StarVehicle.hpp"
|
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
STAR_EXCEPTION(VehicleDatabaseException, StarException);
|
|
|
|
|
|
|
|
class VehicleDatabase {
|
|
|
|
public:
|
|
|
|
VehicleDatabase();
|
|
|
|
|
|
|
|
VehiclePtr create(String const& vehicleName, Json const& extraConfig = Json()) const;
|
|
|
|
|
|
|
|
ByteArray netStore(VehiclePtr const& vehicle) const;
|
|
|
|
VehiclePtr netLoad(ByteArray const& netStore) const;
|
|
|
|
|
|
|
|
Json diskStore(VehiclePtr const& vehicle) const;
|
|
|
|
VehiclePtr diskLoad(Json const& diskStore) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
StringMap<pair<String, Json>> m_vehicles;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|