summaryrefslogtreecommitdiff
path: root/assetFactory
diff options
context:
space:
mode:
Diffstat (limited to 'assetFactory')
-rw-r--r--assetFactory/assetFactory.cpp2
-rw-r--r--assetFactory/style.cpp3
-rw-r--r--assetFactory/use.cpp3
3 files changed, 3 insertions, 5 deletions
diff --git a/assetFactory/assetFactory.cpp b/assetFactory/assetFactory.cpp
index 70f5337..b9724c9 100644
--- a/assetFactory/assetFactory.cpp
+++ b/assetFactory/assetFactory.cpp
@@ -68,7 +68,7 @@ AssetFactory::parseColour(std::string_view in) const
});
return out;
}
- if (auto mf = std::dynamic_pointer_cast<const AssetFactory>(Persistence::sharedObjects.at("assetFactory"))) {
+ if (auto mf = Persistence::ParseBase::getShared<const AssetFactory>("assetFactory")) {
if (const auto colour = mf->colours.find(in); colour != mf->colours.end()) {
return {colour->second, 1};
}
diff --git a/assetFactory/style.cpp b/assetFactory/style.cpp
index b2a2cf7..fc5c34e 100644
--- a/assetFactory/style.cpp
+++ b/assetFactory/style.cpp
@@ -36,8 +36,7 @@ Style::persist(Persistence::PersistenceStore & store)
void
setValue(std::string && str) override
{
- if (auto mf
- = std::dynamic_pointer_cast<const AssetFactory>(Persistence::sharedObjects.at("assetFactory"))) {
+ if (auto mf = Persistence::ParseBase::getShared<const AssetFactory>("assetFactory")) {
v = mf->parseColour(str);
}
}
diff --git a/assetFactory/use.cpp b/assetFactory/use.cpp
index 53fc9b9..708e310 100644
--- a/assetFactory/use.cpp
+++ b/assetFactory/use.cpp
@@ -18,8 +18,7 @@ struct Lookup : public Persistence::SelectionV<Shape::CPtr> {
void
setValue(std::string && str) override
{
- if (auto mf = std::dynamic_pointer_cast<const AssetFactory>(
- Persistence::sharedObjects.at("assetFactory"))) {
+ if (auto mf = Persistence::ParseBase::getShared<const AssetFactory>("assetFactory")) {
v = mf->shapes.at(str);
}
}