summaryrefslogtreecommitdiff
path: root/assetFactory/asset.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-04-07 20:48:14 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2025-04-07 20:48:14 +0100
commitc2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc (patch)
tree0bc8c296e89e53c6f0d9d9e9010adf2db2dc3100 /assetFactory/asset.h
parentMore uniform/flexible window constructors (diff)
downloadilt-c2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc.tar.bz2
ilt-c2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc.tar.xz
ilt-c2aecdc0d6089a3c41b3d15c45cdb49fee6a45cc.zip
Add Asset interface to create an arbitrarily placed instance
InstanceProxy is returned out via a std::any containing a std::shared_ptr because any can only contain copyable things.
Diffstat (limited to 'assetFactory/asset.h')
-rw-r--r--assetFactory/asset.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/assetFactory/asset.h b/assetFactory/asset.h
index b5de056..061a7c8 100644
--- a/assetFactory/asset.h
+++ b/assetFactory/asset.h
@@ -2,17 +2,22 @@
#include "factoryMesh.h"
#include "persistence.h"
+#include <any>
#include <manyPtr.h>
#include <stdTypeDefs.h>
class TextureAtlas;
class Renderable;
+class Location;
class Asset : public Persistence::Persistable, public StdTypeDefs<Asset> {
public:
using ManyPtr = ManySharedPtr<Asset, const Renderable>;
using TexturePtr = std::shared_ptr<TextureAtlas>;
+ /// Used only for the asset viewer
+ [[nodiscard]] virtual std::any createAt(const Location &) const;
+
std::string id;
std::string name;