diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-22 13:01:14 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-22 13:01:14 +0000 |
commit | 163c8f75265054a168cc1e2750a0adb40fb08d83 (patch) | |
tree | 3f5aeb2c912fe079029e53fcd5aa29e5f245c814 /game | |
parent | Invert how shared/unique is specified for Collection (diff) | |
download | ilt-163c8f75265054a168cc1e2750a0adb40fb08d83.tar.bz2 ilt-163c8f75265054a168cc1e2750a0adb40fb08d83.tar.xz ilt-163c8f75265054a168cc1e2750a0adb40fb08d83.zip |
Make Collections::objects protected, extend interface
Keeps all required features accessible, but through a controlled
interface.
Diffstat (limited to 'game')
-rw-r--r-- | game/network/network.impl.h | 8 | ||||
-rw-r--r-- | game/network/rail.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/game/network/network.impl.h b/game/network/network.impl.h index 0a2f9ca..294f696 100644 --- a/game/network/network.impl.h +++ b/game/network/network.impl.h @@ -8,7 +8,7 @@ template<typename T, typename... Links> void NetworkOf<T, Links...>::joinLinks(const Link::Ptr & l) const { - for (const auto & ol : links.objects) { + for (const auto & ol : links) { Network::joinLinks(l, ol); } } @@ -18,11 +18,11 @@ Link::Ptr NetworkOf<T, Links...>::intersectRayLinks(const Ray<GlobalPosition3D> & ray) const { // Click link - if (const auto link = std::find_if(links.objects.begin(), links.objects.end(), + if (const auto link = std::find_if(links.begin(), links.end(), [&ray](const std::shared_ptr<T> & link) { return link->intersectRay(ray); }); - link != links.objects.end()) { + link != links.end()) { return *link; } return {}; @@ -32,7 +32,7 @@ template<typename T, typename... Links> float NetworkOf<T, Links...>::findNodeDirection(Node::AnyCPtr n) const { - for (const auto & l : links.objects) { + for (const auto & l : links) { for (const auto & e : l->ends) { // cppcheck-suppress useStlAlgorithm if (e.node.get() == n.get()) { diff --git a/game/network/rail.cpp b/game/network/rail.cpp index 5ce6036..dfe1dca 100644 --- a/game/network/rail.cpp +++ b/game/network/rail.cpp @@ -168,7 +168,7 @@ namespace { void RailLinks::render(const SceneShader & shader, const Frustum &) const { - if (!links.objects.empty()) { + if (!links.empty()) { texture->bind(); glEnable(GL_POLYGON_OFFSET_FILL); glPolygonOffset(-1, 0); |