diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-13 19:21:14 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-13 19:21:14 +0000 |
commit | 66d4605d825c55c64f13a6547192ebb9c64ca2d8 (patch) | |
tree | 8c950eb8bb76c0a8da1a150d4ab91dcffa51a60f /test | |
parent | Add missing virtual destructor in Renderable (diff) | |
download | ilt-66d4605d825c55c64f13a6547192ebb9c64ca2d8.tar.bz2 ilt-66d4605d825c55c64f13a6547192ebb9c64ca2d8.tar.xz ilt-66d4605d825c55c64f13a6547192ebb9c64ca2d8.zip |
Simplified TestLink extending LinkStraight
Diffstat (limited to 'test')
-rw-r--r-- | test/test-network.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/test/test-network.cpp b/test/test-network.cpp index 1228e81..e5a2074 100644 --- a/test/test-network.cpp +++ b/test/test-network.cpp @@ -9,7 +9,6 @@ #include <game/network/network.h> #include <game/network/network.impl.h> // IWYU pragma: keep #include <glm/glm.hpp> -#include <location.hpp> #include <maths.h> #include <memory> #include <stdexcept> @@ -17,13 +16,8 @@ #include <utility> #include <vector> -struct TestLink : public Link { - TestLink(NodePtr a, NodePtr b, float ad, float bd, float l) : Link {{std::move(a), ad}, {std::move(b), bd}, l} { } - [[nodiscard]] Location - positionAt(float, unsigned char) const override - { - throw std::runtime_error("not implemented"); - } +struct TestLink : public LinkStraight { + TestLink(NodePtr a, NodePtr b, float l) : Link {{std::move(a), 0}, {std::move(b), pi}, l} { } }; constexpr glm::vec3 p000 {0, 0, 0}, p100 {1, 0, 0}, p200 {2, 0, 0}, p300 {3, 0, 0}; @@ -38,12 +32,12 @@ struct TestNetwork : public NetworkOf<TestLink> { // \ 5 / // 3 | 4 // \-> p101 <-/ - addLink<TestLink>(p000, p100, 0.F, pi, 1.F); - addLink<TestLink>(p100, p200, 0.F, pi, 1.F); - addLink<TestLink>(p200, p300, 0.F, pi, 1.F); - addLink<TestLink>(p000, p101, 0.F, pi, 2.F); - addLink<TestLink>(p200, p101, 0.F, pi, 2.F); - addLink<TestLink>(p100, p101, 0.F, pi, 1.F); + addLink<TestLink>(p000, p100, 1.F); + addLink<TestLink>(p100, p200, 1.F); + addLink<TestLink>(p200, p300, 1.F); + addLink<TestLink>(p000, p101, 2.F); + addLink<TestLink>(p200, p101, 2.F); + addLink<TestLink>(p100, p101, 1.F); } }; |