summaryrefslogtreecommitdiff
path: root/game/network/rail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/network/rail.cpp')
-rw-r--r--game/network/rail.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/game/network/rail.cpp b/game/network/rail.cpp
index fd2ea08..a66bf65 100644
--- a/game/network/rail.cpp
+++ b/game/network/rail.cpp
@@ -16,6 +16,23 @@ RailLinks::RailLinks() : texture {Texture::cachedTexture.get("rails.jpg")} { }
void RailLinks::tick(TickDuration) { }
void
+RailLinks::joinLinks(LinkPtr l) const
+{
+ for (const auto & ol : links.objects) {
+ if (l != ol) {
+ for (const auto oe : {0, 1}) {
+ for (const auto te : {0, 1}) {
+ if (l->ends[te].first == ol->ends[oe].first) {
+ l->nexts[te].emplace_back(ol.get(), oe);
+ ol->nexts[oe].emplace_back(l.get(), te);
+ }
+ }
+ }
+ }
+ }
+}
+
+void
RailLinks::render(const Shader & shader) const
{
shader.setModel(glm::identity<glm::mat4>());