summaryrefslogtreecommitdiff
path: root/assetFactory
diff options
context:
space:
mode:
Diffstat (limited to 'assetFactory')
-rw-r--r--assetFactory/asset.cpp8
-rw-r--r--assetFactory/asset.h17
-rw-r--r--assetFactory/assetFactory.cpp7
-rw-r--r--assetFactory/assetFactory.h15
4 files changed, 26 insertions, 21 deletions
diff --git a/assetFactory/asset.cpp b/assetFactory/asset.cpp
new file mode 100644
index 0000000..fa30a78
--- /dev/null
+++ b/assetFactory/asset.cpp
@@ -0,0 +1,8 @@
+#include "asset.h"
+
+bool
+Asset::persist(Persistence::PersistenceStore & store)
+{
+ return STORE_TYPE && STORE_MEMBER(id) && STORE_MEMBER(name)
+ && STORE_NAME_HELPER("mesh", meshes, Persistence::Appender<FactoryMesh::Collection>);
+}
diff --git a/assetFactory/asset.h b/assetFactory/asset.h
new file mode 100644
index 0000000..d86b804
--- /dev/null
+++ b/assetFactory/asset.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "factoryMesh.h"
+#include "persistence.h"
+#include <stdTypeDefs.hpp>
+
+class Asset : public Persistence::Persistable, public StdTypeDefs<Asset> {
+public:
+ std::string id;
+ std::string name;
+
+ FactoryMesh::Collection meshes;
+
+protected:
+ friend Persistence::SelectionPtrBase<std::shared_ptr<Asset>>;
+ bool persist(Persistence::PersistenceStore & store) override;
+};
diff --git a/assetFactory/assetFactory.cpp b/assetFactory/assetFactory.cpp
index b9724c9..f5fc2b3 100644
--- a/assetFactory/assetFactory.cpp
+++ b/assetFactory/assetFactory.cpp
@@ -83,10 +83,3 @@ AssetFactory::persist(Persistence::PersistenceStore & store)
return STORE_TYPE && STORE_NAME_HELPER("object", shapes, MapObjects)
&& STORE_NAME_HELPER("asset", assets, MapAssets);
}
-
-bool
-Asset::persist(Persistence::PersistenceStore & store)
-{
- return STORE_TYPE && STORE_MEMBER(id) && STORE_MEMBER(name)
- && STORE_NAME_HELPER("mesh", meshes, Persistence::Appender<FactoryMesh::Collection>);
-}
diff --git a/assetFactory/assetFactory.h b/assetFactory/assetFactory.h
index 2bd576b..b47d408 100644
--- a/assetFactory/assetFactory.h
+++ b/assetFactory/assetFactory.h
@@ -1,22 +1,9 @@
#pragma once
-#include "factoryMesh.h"
+#include "asset.h"
#include "persistence.h"
#include "shape.h"
#include <filesystem>
-#include <stdTypeDefs.hpp>
-
-class Asset : public Persistence::Persistable, public StdTypeDefs<Asset> {
-public:
- std::string id;
- std::string name;
-
- FactoryMesh::Collection meshes;
-
-private:
- friend Persistence::SelectionPtrBase<std::shared_ptr<Asset>>;
- bool persist(Persistence::PersistenceStore & store) override;
-};
class AssetFactory : public Persistence::Persistable {
public: