osb/source/game/StarVehicleDatabase.hpp

27 lines
617 B
C++
Raw Normal View History

#pragma once
2023-06-20 14:33:09 +10: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;
2024-09-05 19:15:47 +10:00
ByteArray netStore(VehiclePtr const& vehicle, NetCompatibilityRules rules) const;
VehiclePtr netLoad(ByteArray const& netStore, NetCompatibilityRules rules) const;
2023-06-20 14:33:09 +10:00
Json diskStore(VehiclePtr const& vehicle) const;
VehiclePtr diskLoad(Json const& diskStore) const;
private:
StringMap<pair<String, Json>> m_vehicles;
};
}