From 873ef1436e233b5b4c542f35838a7cd73432ede6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 22 Oct 2022 19:06:14 +0100 Subject: Tidy network node insertion/searching --- game/network/network.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'game/network/network.h') 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 newNodeAt(glm::vec3); - [[nodiscard]] std::pair candidateNodeAt(glm::vec3) const; + enum class NodeIs { InNetwork, NotInNetwork }; + using NodeInsertion = std::pair; + [[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(); }; -- cgit v1.2.3