summaryrefslogtreecommitdiff
path: root/game/network/network.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-10-13 20:27:46 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-10-13 20:27:46 +0100
commitfab2d34959c52383f6be3cb6634c6776b41f62a8 (patch)
treecbf8f4b717d50af882689b5e012c2e3737f44077 /game/network/network.cpp
parentInheritable of standard typedefs (diff)
downloadilt-fab2d34959c52383f6be3cb6634c6776b41f62a8.tar.bz2
ilt-fab2d34959c52383f6be3cb6634c6776b41f62a8.tar.xz
ilt-fab2d34959c52383f6be3cb6634c6776b41f62a8.zip
Standard typedefs for Node
Diffstat (limited to 'game/network/network.cpp')
-rw-r--r--game/network/network.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/game/network/network.cpp b/game/network/network.cpp
index 9683143..25dc384 100644
--- a/game/network/network.cpp
+++ b/game/network/network.cpp
@@ -13,13 +13,13 @@
Network::Network(const std::string & tn) : texture {Texture::cachedTexture.get(tn)} { }
-NodePtr
+Node::Ptr
Network::nodeAt(glm::vec3 pos)
{
return newNodeAt(pos).first;
}
-std::pair<NodePtr, bool>
+std::pair<Node::Ptr, bool>
Network::newNodeAt(glm::vec3 pos)
{
const auto [n, i] = candidateNodeAt(pos);
@@ -29,7 +29,7 @@ Network::newNodeAt(glm::vec3 pos)
return {n, !i};
}
-NodePtr
+Node::Ptr
Network::findNodeAt(glm::vec3 pos) const
{
if (const auto n = nodes.find(pos); n != nodes.end()) {
@@ -38,7 +38,7 @@ Network::findNodeAt(glm::vec3 pos) const
return {};
}
-std::pair<NodePtr, bool>
+std::pair<Node::Ptr, bool>
Network::candidateNodeAt(glm::vec3 pos) const
{
if (const auto n = nodes.find(pos); n != nodes.end()) {
@@ -47,12 +47,12 @@ Network::candidateNodeAt(glm::vec3 pos) const
return {std::make_shared<Node>(pos), false};
}
-NodePtr
+Node::Ptr
Network::intersectRayNodes(const Ray & ray) const
{
// Click within 2m of a node
if (const auto node = std::find_if(nodes.begin(), nodes.end(),
- [&ray](const NodePtr & node) {
+ [&ray](const Node::Ptr & node) {
glm::vec3 ipos, inorm;
return glm::intersectRaySphere(ray.start, ray.direction, node->pos, 2.F, ipos, inorm);
});
@@ -88,7 +88,7 @@ Network::routeFromTo(const Link::End & start, glm::vec3 dest) const
}
Link::Nexts
-Network::routeFromTo(const Link::End & end, const NodePtr & dest) const
+Network::routeFromTo(const Link::End & end, const Node::Ptr & dest) const
{
return RouteWalker().findRouteTo(end, dest);
}