summaryrefslogtreecommitdiff
path: root/assetFactory/assetFactory.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-02-22 23:40:46 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-02-22 23:40:46 +0000
commitdf2a078c51cee464905c6fb1d1c7c4aa7873f6a1 (patch)
tree209467479c61ab42bf39510f32fd375027115dcd /assetFactory/assetFactory.cpp
parentFixup MapByMember to work with shared or unique ptr (diff)
downloadilt-df2a078c51cee464905c6fb1d1c7c4aa7873f6a1.tar.bz2
ilt-df2a078c51cee464905c6fb1d1c7c4aa7873f6a1.tar.xz
ilt-df2a078c51cee464905c6fb1d1c7c4aa7873f6a1.zip
Implement loading asset, mesh and face definitions
Diffstat (limited to 'assetFactory/assetFactory.cpp')
-rw-r--r--assetFactory/assetFactory.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/assetFactory/assetFactory.cpp b/assetFactory/assetFactory.cpp
index 470eacf..564ea28 100644
--- a/assetFactory/assetFactory.cpp
+++ b/assetFactory/assetFactory.cpp
@@ -27,5 +27,14 @@ bool
AssetFactory::persist(Persistence::PersistenceStore & store)
{
using MapObjects = Persistence::MapByMember<Shapes, std::shared_ptr<Object>>;
- return STORE_TYPE && STORE_NAME_HELPER("object", shapes, MapObjects);
+ using MapAssets = Persistence::MapByMember<Assets>;
+ 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>);
}