summaryrefslogtreecommitdiff
path: root/game/network/link.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-02-05 00:30:13 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-05 00:30:13 +0000
commitc1ea14d1c96de18448c0c3779d30b7e1e4451f61 (patch)
treeb97edc04e70495caf49545dc30ed9936d1986d07 /game/network/link.cpp
parentCreate terrain as collection of meshes (diff)
downloadilt-c1ea14d1c96de18448c0c3779d30b7e1e4451f61.tar.bz2
ilt-c1ea14d1c96de18448c0c3779d30b7e1e4451f61.tar.xz
ilt-c1ea14d1c96de18448c0c3779d30b7e1e4451f61.zip
Initial commit generating some basic rail network
Diffstat (limited to 'game/network/link.cpp')
-rw-r--r--game/network/link.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/game/network/link.cpp b/game/network/link.cpp
new file mode 100644
index 0000000..65aefd6
--- /dev/null
+++ b/game/network/link.cpp
@@ -0,0 +1,18 @@
+#include "link.h"
+#include <compare>
+#include <tuple>
+
+Link::Link(End a, End b) : ends {{std::move(a), std::move(b)}} { }
+
+bool
+operator<(const glm::vec3 & a, const glm::vec3 & b)
+{
+ // NOLINTNEXTLINE(hicpp-use-nullptr,modernize-use-nullptr)
+ return std::tie(a.x, a.z, a.y) < std::tie(b.x, b.z, b.y);
+}
+
+bool
+operator<(const Node & a, const Node & b)
+{
+ return a.pos < b.pos;
+}