From 6f1c6ce24062368d4f3003124f6cd431ed039e21 Mon Sep 17 00:00:00 2001 From: Moritz Heinemann Date: Sun, 25 Feb 2024 21:53:25 +0100 Subject: [PATCH] use property getter --- map/src/MapWindow/DataView/SplineData.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/map/src/MapWindow/DataView/SplineData.cpp b/map/src/MapWindow/DataView/SplineData.cpp index 47aac841..df6c345b 100644 --- a/map/src/MapWindow/DataView/SplineData.cpp +++ b/map/src/MapWindow/DataView/SplineData.cpp @@ -15,18 +15,8 @@ namespace { glm::vec3 leaveTangent; }; - SatisfactorySave::ArrayProperty& getSplineDataProperty(const SatisfactorySave::PropertyList& properties) { - for (const auto& p : properties) { - if (p->name() == "mSplineData" && p->type() == SatisfactorySave::ArrayProperty::TypeName) { - return dynamic_cast(*p); - } - } - - throw std::runtime_error("mSplineData property missing!"); - } - std::vector getSplineData(const SatisfactorySave::SaveActor& a) { - auto& ap = getSplineDataProperty(a.Properties); + auto& ap = a.Properties.get("mSplineData"); if (ap.arrayType() != SatisfactorySave::StructProperty::TypeName) { throw std::runtime_error("Expect StructProperty!"); }