From d240fc840ebe35499e09c48960d4d89ce25c2824 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 10 Mar 2021 01:20:08 +0000 Subject: Add some more helpers to Network --- game/network/network.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'game/network/network.cpp') diff --git a/game/network/network.cpp b/game/network/network.cpp index adda8fc..52d88ec 100644 --- a/game/network/network.cpp +++ b/game/network/network.cpp @@ -2,9 +2,23 @@ #include #include #include +#include Network::Network(const std::string & tn) : texture {Texture::cachedTexture.get(tn)} { } +NodePtr +Network::nodeAt(glm::vec3 pos) +{ + return *nodes.insert(std::make_shared(pos)).first; +} + +std::pair +Network::newNodeAt(glm::vec3 pos) +{ + const auto i = nodes.insert(std::make_shared(pos)); + return {*i.first, i.second}; +} + NodePtr Network::findNodeAt(glm::vec3 pos) const { -- cgit v1.2.3