diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-10 00:53:08 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-10 00:53:08 +0000 |
commit | c274ac05690b34ba05b41d6e7864e6a663c73c1a (patch) | |
tree | b73b3654ae8cd99deba893b278378a4831e5c70c /game/network/rail.h | |
parent | Add findNodeAt to locate a node instance by position (diff) | |
download | ilt-c274ac05690b34ba05b41d6e7864e6a663c73c1a.tar.bz2 ilt-c274ac05690b34ba05b41d6e7864e6a663c73c1a.tar.xz ilt-c274ac05690b34ba05b41d6e7864e6a663c73c1a.zip |
Push RailLinks functionality into new base classes Network and NetworkOf<>
Diffstat (limited to 'game/network/rail.h')
-rw-r--r-- | game/network/rail.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/game/network/rail.h b/game/network/rail.h index 4460fcd..1d0ef68 100644 --- a/game/network/rail.h +++ b/game/network/rail.h @@ -7,17 +7,16 @@ #include "gfx/models/vertex.hpp" #include "gfx/renderable.h" #include "link.h" +#include "network.h" #include <glm/glm.hpp> #include <location.hpp> #include <maths.h> #include <memory> #include <set> -#include <sorting.hpp> #include <utility> #include <vector> class Shader; -class Texture; // A piece of rail track class RailLink : public Link, public Renderable { @@ -57,7 +56,7 @@ private: template<typename T> concept RailLinkConcept = std::is_base_of_v<RailLink, T>; -class RailLinks : public Renderable, public WorldObject { +class RailLinks : public NetworkOf<RailLink>, public WorldObject { public: RailLinks(); template<RailLinkConcept T, typename... Params> @@ -72,16 +71,10 @@ public: } std::shared_ptr<RailLink> addLinksBetween(glm::vec3 start, glm::vec3 end); - [[nodiscard]] NodePtr findNodeAt(glm::vec3) const; private: - using Nodes = std::set<NodePtr, PtrSorter<NodePtr>>; - Collection<RailLink> links; - Nodes nodes; - void render(const Shader &) const override; void tick(TickDuration elapsed) override; void joinLinks(const LinkPtr &) const; - std::shared_ptr<Texture> texture; }; #endif |