summaryrefslogtreecommitdiff
path: root/game/network/network.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/network/network.cpp')
-rw-r--r--game/network/network.cpp14
1 files changed, 14 insertions, 0 deletions
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,10 +2,24 @@
#include <cache.h>
#include <game/network/link.h>
#include <gfx/models/texture.h>
+#include <utility>
Network::Network(const std::string & tn) : texture {Texture::cachedTexture.get(tn)} { }
NodePtr
+Network::nodeAt(glm::vec3 pos)
+{
+ return *nodes.insert(std::make_shared<Node>(pos)).first;
+}
+
+std::pair<NodePtr, bool>
+Network::newNodeAt(glm::vec3 pos)
+{
+ const auto i = nodes.insert(std::make_shared<Node>(pos));
+ return {*i.first, i.second};
+}
+
+NodePtr
Network::findNodeAt(glm::vec3 pos) const
{
if (const auto n = nodes.find(std::make_shared<Node>(pos)); n != nodes.end()) {