From c274ac05690b34ba05b41d6e7864e6a663c73c1a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 10 Mar 2021 00:53:08 +0000 Subject: Push RailLinks functionality into new base classes Network and NetworkOf<> --- game/network/network.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 game/network/network.cpp (limited to 'game/network/network.cpp') diff --git a/game/network/network.cpp b/game/network/network.cpp new file mode 100644 index 0000000..adda8fc --- /dev/null +++ b/game/network/network.cpp @@ -0,0 +1,15 @@ +#include "network.h" +#include +#include +#include + +Network::Network(const std::string & tn) : texture {Texture::cachedTexture.get(tn)} { } + +NodePtr +Network::findNodeAt(glm::vec3 pos) const +{ + if (const auto n = nodes.find(std::make_shared(pos)); n != nodes.end()) { + return *n; + } + return {}; +} -- cgit v1.2.3