summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
Diffstat (limited to 'game')
-rw-r--r--game/network/link.h1
-rw-r--r--game/network/network.h8
-rw-r--r--game/network/network.impl.h6
3 files changed, 8 insertions, 7 deletions
diff --git a/game/network/link.h b/game/network/link.h
index d9629de..6441c8b 100644
--- a/game/network/link.h
+++ b/game/network/link.h
@@ -61,6 +61,7 @@ protected:
return {};
}
};
+using CLinks = std::vector<LinkCPtr>;
bool operator<(const glm::vec3 & a, const glm::vec3 & b);
bool operator<(const Node & a, const Node & b);
diff --git a/game/network/network.h b/game/network/network.h
index 9dbca7c..d561e55 100644
--- a/game/network/network.h
+++ b/game/network/network.h
@@ -30,8 +30,8 @@ public:
[[nodiscard]] Link::Nexts routeFromTo(const Link::End &, glm::vec3) const;
[[nodiscard]] Link::Nexts routeFromTo(const Link::End &, const NodePtr &) const;
- virtual LinkPtr addStraight(glm::vec3, glm::vec3) = 0;
- virtual LinkPtr addJoins(glm::vec3, glm::vec3) = 0;
+ virtual LinkCPtr addStraight(glm::vec3, glm::vec3) = 0;
+ virtual CLinks addJoins(glm::vec3, glm::vec3) = 0;
protected:
static void joinLinks(const LinkPtr & l, const LinkPtr & ol);
@@ -63,8 +63,8 @@ public:
return l;
}
- LinkPtr addStraight(glm::vec3 n1, glm::vec3 n2) override;
- LinkPtr addJoins(glm::vec3, glm::vec3) override;
+ LinkCPtr addStraight(glm::vec3 n1, glm::vec3 n2) override;
+ CLinks addJoins(glm::vec3, glm::vec3) override;
void render(const Shader &) const override;
};
diff --git a/game/network/network.impl.h b/game/network/network.impl.h
index 37d03f8..4e2b37e 100644
--- a/game/network/network.impl.h
+++ b/game/network/network.impl.h
@@ -38,15 +38,15 @@ NetworkOf<T>::intersectRayLinks(const Ray & ray) const
}
template<typename T>
-LinkPtr
+LinkCPtr
NetworkOf<T>::addStraight(glm::vec3 n1, glm::vec3 n2)
{
return addLink<typename T::StraightLink>(n1, n2);
}
template<typename T>
-LinkPtr
+CLinks
NetworkOf<T>::addJoins(glm::vec3 n1, glm::vec3 n2)
{
- return addLink<typename T::StraightLink>(n1, n2);
+ return {addLink<typename T::StraightLink>(n1, n2)};
}