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.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 game/network/network.h (limited to 'game/network/network.h') diff --git a/game/network/network.h b/game/network/network.h new file mode 100644 index 0000000..2c24916 --- /dev/null +++ b/game/network/network.h @@ -0,0 +1,38 @@ +#ifndef NETWORK_H +#define NETWORK_H + +#include "link.h" +#include +#include +#include +#include +#include +#include +#include + +class Texture; +class Shader; + +class Network { +public: + explicit Network(const std::string & textureName); + + [[nodiscard]] NodePtr findNodeAt(glm::vec3) const; + +protected: + using Nodes = std::set>; + Nodes nodes; + std::shared_ptr texture; +}; + +template class NetworkOf : public Network, public Renderable { +protected: + using Network::Network; + + Collection links; + +public: + void render(const Shader &) const override; +}; + +#endif -- cgit v1.2.3