summaryrefslogtreecommitdiff
path: root/assetFactory/assetFactory.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-02-21 19:34:16 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-02-21 19:34:16 +0000
commit5e561d390dc82b08c20532de0952f428e7b14283 (patch)
tree5f213d4eb741e451b913884b6f302470e7b2fc74 /assetFactory/assetFactory.h
parentSupport for loading objects, uses and model factories from an XML resource (diff)
downloadilt-5e561d390dc82b08c20532de0952f428e7b14283.tar.bz2
ilt-5e561d390dc82b08c20532de0952f428e7b14283.tar.xz
ilt-5e561d390dc82b08c20532de0952f428e7b14283.zip
Rename ModelFactory to AssetFactory
Diffstat (limited to 'assetFactory/assetFactory.h')
-rw-r--r--assetFactory/assetFactory.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/assetFactory/assetFactory.h b/assetFactory/assetFactory.h
new file mode 100644
index 0000000..5cf90dd
--- /dev/null
+++ b/assetFactory/assetFactory.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "persistence.h"
+#include "shape.h"
+#include <filesystem>
+
+class AssetFactory : public Persistence::Persistable {
+public:
+ using Shapes = std::map<std::string, Shape::CPtr, std::less<>>;
+
+ AssetFactory();
+ [[nodiscard]] static std::shared_ptr<AssetFactory> loadXML(const std::filesystem::path &);
+
+ Shapes shapes;
+
+private:
+ friend Persistence::SelectionPtrBase<std::shared_ptr<AssetFactory>, true>;
+ bool persist(Persistence::PersistenceStore & store) override;
+};