From 54ddcd3da0916b6a46f5fcf3f33ff0fbffe375ce Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 4 Mar 2023 14:27:23 +0000 Subject: Support and load factory asset directly into a RailVehicleClass instance --- game/vehicles/railVehicleClass.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'game/vehicles/railVehicleClass.h') diff --git a/game/vehicles/railVehicleClass.h b/game/vehicles/railVehicleClass.h index bd74ab9..c50dacc 100644 --- a/game/vehicles/railVehicleClass.h +++ b/game/vehicles/railVehicleClass.h @@ -1,5 +1,6 @@ #pragma once +#include "assetFactory/asset.h" #include "gfx/models/mesh.h" #include #include @@ -11,9 +12,10 @@ class Texture; class ObjParser; class Location; -class RailVehicleClass { +class RailVehicleClass : public Asset { public: explicit RailVehicleClass(const std::string & name); + RailVehicleClass(); void render(const SceneShader &, const Location &, const std::array &) const; void shadows(const ShadowMapper &, const Location &) const; @@ -25,6 +27,10 @@ public: float length; float maxSpeed; +protected: + friend Persistence::SelectionPtrBase>; + bool persist(Persistence::PersistenceStore & store) override; + private: RailVehicleClass(std::unique_ptr obj, std::shared_ptr); static float bogieOffset(ObjParser & o); -- cgit v1.2.3