summaryrefslogtreecommitdiff
path: root/assetFactory/object.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-02-21 20:09:41 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-02-21 20:09:41 +0000
commitf91e2ea8d9e30b1e62c4f8784fddfd4eb9578d2d (patch)
treefa0326b9d09687c79360cfbd738ce4e14ef0b1d3 /assetFactory/object.cpp
parentRename ModelFactory to AssetFactory (diff)
downloadilt-f91e2ea8d9e30b1e62c4f8784fddfd4eb9578d2d.tar.bz2
ilt-f91e2ea8d9e30b1e62c4f8784fddfd4eb9578d2d.tar.xz
ilt-f91e2ea8d9e30b1e62c4f8784fddfd4eb9578d2d.zip
Move Appender in Persistence NS and simplify types
Diffstat (limited to 'assetFactory/object.cpp')
-rw-r--r--assetFactory/object.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/assetFactory/object.cpp b/assetFactory/object.cpp
index faa9a17..ae5a301 100644
--- a/assetFactory/object.cpp
+++ b/assetFactory/object.cpp
@@ -16,24 +16,8 @@ Object::createMesh(ModelFactoryMesh & mesh, const Mutation::Matrix & mutation) c
return faces;
}
-template<typename Container, typename Type> struct Appender : public Persistence::SelectionT<std::shared_ptr<Type>> {
- Appender(Container & c) : Persistence::SelectionT<std::shared_ptr<Type>> {s}, container {c} { }
- using Persistence::SelectionT<std::shared_ptr<Type>>::SelectionT;
- void
- endObject(Persistence::Stack & stk) override
- {
- container.emplace_back(s);
- stk.pop();
- }
-
-private:
- std::shared_ptr<Type> s;
- Container & container;
-};
-
bool
Object::persist(Persistence::PersistenceStore & store)
{
- using UseAppend = Appender<Use::Collection, Use>;
- return STORE_TYPE && STORE_MEMBER(id) && STORE_NAME_HELPER("use", uses, UseAppend);
+ return STORE_TYPE && STORE_MEMBER(id) && STORE_NAME_HELPER("use", uses, Persistence::Appender<Use::Collection>);
}