summaryrefslogtreecommitdiff
path: root/ui/builders/freeExtend.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-12-18 19:56:38 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-12-18 19:56:40 +0000
commit5cba33aedccdfa79f1c291bc1da8ff2223d5c70a (patch)
tree1aeb276c496edbd8beea180d9d032583d27cef49 /ui/builders/freeExtend.cpp
parentAdd sanity checking logic to GeoData (diff)
downloadilt-5cba33aedccdfa79f1c291bc1da8ff2223d5c70a.tar.bz2
ilt-5cba33aedccdfa79f1c291bc1da8ff2223d5c70a.tar.xz
ilt-5cba33aedccdfa79f1c291bc1da8ff2223d5c70a.zip
Give UI builders an interface that can be programmatically called
Diffstat (limited to 'ui/builders/freeExtend.cpp')
-rw-r--r--ui/builders/freeExtend.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/ui/builders/freeExtend.cpp b/ui/builders/freeExtend.cpp
index db127e6..904e144 100644
--- a/ui/builders/freeExtend.cpp
+++ b/ui/builders/freeExtend.cpp
@@ -38,11 +38,11 @@ BuilderFreeExtend::click(
case SDL_BUTTON_LEFT:
if (p1) {
if (const auto p = network->intersectRayNodes(ray)) {
- network->addJoins(*p1, p->pos);
+ createJoin(network, *p1, p->pos);
p1 = p->pos;
}
else if (const auto p = geoData->intersectRay(ray)) {
- network->addExtend(*p1, p->first);
+ createExtend(network, *p1, p->first);
p1 = p->first;
}
}
@@ -57,3 +57,15 @@ BuilderFreeExtend::click(
return;
}
}
+
+Link::CCollection
+BuilderFreeExtend::createJoin(Network * network, GlobalPosition3D p1, GlobalPosition3D p2) const
+{
+ return network->addJoins(p1, p2);
+}
+
+Link::CCollection
+BuilderFreeExtend::createExtend(Network * network, GlobalPosition3D p1, GlobalPosition3D p2) const
+{
+ return network->addExtend(p1, p2);
+}