diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-10 01:54:40 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-10 01:54:40 +0000 |
commit | 789a16e4e97d4050bb8db9cc3aebb01e807ac8c7 (patch) | |
tree | a5e0fc0f406c17e1b7b88ba8e16ea0bbb331a6dc /game/network/rail.h | |
parent | Add some more helpers to Network (diff) | |
download | ilt-789a16e4e97d4050bb8db9cc3aebb01e807ac8c7.tar.bz2 ilt-789a16e4e97d4050bb8db9cc3aebb01e807ac8c7.tar.xz ilt-789a16e4e97d4050bb8db9cc3aebb01e807ac8c7.zip |
Push more RailLinks logic down into NetworkOf
Diffstat (limited to 'game/network/rail.h')
-rw-r--r-- | game/network/rail.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/game/network/rail.h b/game/network/rail.h index 3b3da42..3ecc59f 100644 --- a/game/network/rail.h +++ b/game/network/rail.h @@ -11,7 +11,6 @@ #include <maths.h> #include <memory> #include <span> -#include <utility> class Shader; class Vertex; @@ -50,26 +49,14 @@ private: Arc arc; }; -template<typename T> concept RailLinkConcept = std::is_base_of_v<RailLink, T>; - class RailLinks : public NetworkOf<RailLink>, public WorldObject { public: RailLinks(); - template<RailLinkConcept T, typename... Params> - std::shared_ptr<T> - addLink(glm::vec3 a, glm::vec3 b, Params &&... params) - { - const auto node1 = nodeAt(a), node2 = nodeAt(b); - auto l {links.create<T>(node1, node2, std::forward<Params>(params)...)}; - joinLinks(l); - return l; - } std::shared_ptr<RailLink> addLinksBetween(glm::vec3 start, glm::vec3 end); private: void tick(TickDuration elapsed) override; - void joinLinks(const LinkPtr &) const; }; #endif |