summaryrefslogtreecommitdiff
path: root/game/network/network.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-10-22 19:06:14 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-10-22 19:06:14 +0100
commit873ef1436e233b5b4c542f35838a7cd73432ede6 (patch)
treead5b0f0bba71c5da5791471216855a1af221c26e /game/network/network.h
parentMove -Wold-style-cast to gcc only list, clang triggers in some SDL headers (diff)
downloadilt-873ef1436e233b5b4c542f35838a7cd73432ede6.tar.bz2
ilt-873ef1436e233b5b4c542f35838a7cd73432ede6.tar.xz
ilt-873ef1436e233b5b4c542f35838a7cd73432ede6.zip
Tidy network node insertion/searching
Diffstat (limited to 'game/network/network.h')
-rw-r--r--game/network/network.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/game/network/network.h b/game/network/network.h
index b95dfdc..25f0200 100644
--- a/game/network/network.h
+++ b/game/network/network.h
@@ -23,8 +23,10 @@ public:
[[nodiscard]] Node::Ptr findNodeAt(glm::vec3) const;
[[nodiscard]] Node::Ptr nodeAt(glm::vec3);
- [[nodiscard]] std::pair<Node::Ptr, bool> newNodeAt(glm::vec3);
- [[nodiscard]] std::pair<Node::Ptr, bool> candidateNodeAt(glm::vec3) const;
+ enum class NodeIs { InNetwork, NotInNetwork };
+ using NodeInsertion = std::pair<Node::Ptr, NodeIs>;
+ [[nodiscard]] NodeInsertion newNodeAt(glm::vec3);
+ [[nodiscard]] NodeInsertion candidateNodeAt(glm::vec3) const;
[[nodiscard]] virtual Link::Ptr intersectRayLinks(const Ray &) const = 0;
[[nodiscard]] virtual Node::Ptr intersectRayNodes(const Ray &) const;
@@ -85,4 +87,7 @@ public:
Link::CCollection addExtend(glm::vec3, glm::vec3) override;
void render(const Shader &) const override;
+
+protected:
+ Link::CCollection addJoins();
};