Skip to content

Commit

Permalink
use property getter
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz-h committed Feb 25, 2024
1 parent 5b9c4cb commit 6f1c6ce
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions map/src/MapWindow/DataView/SplineData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<SatisfactorySave::ArrayProperty&>(*p);
}
}

throw std::runtime_error("mSplineData property missing!");
}

std::vector<SplinePointData> getSplineData(const SatisfactorySave::SaveActor& a) {
auto& ap = getSplineDataProperty(a.Properties);
auto& ap = a.Properties.get<SatisfactorySave::ArrayProperty>("mSplineData");
if (ap.arrayType() != SatisfactorySave::StructProperty::TypeName) {
throw std::runtime_error("Expect StructProperty!");
}
Expand Down

0 comments on commit 6f1c6ce

Please sign in to comment.