Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarVehicleDatabase.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /source/game/StarVehicleDatabase.hpp
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'source/game/StarVehicleDatabase.hpp')
-rw-r--r--source/game/StarVehicleDatabase.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/game/StarVehicleDatabase.hpp b/source/game/StarVehicleDatabase.hpp
new file mode 100644
index 0000000..4bdacbe
--- /dev/null
+++ b/source/game/StarVehicleDatabase.hpp
@@ -0,0 +1,29 @@
+#ifndef STAR_VEHICLE_DATABASE_HPP
+#define STAR_VEHICLE_DATABASE_HPP
+
+#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;
+};
+
+}
+
+#endif