From 35868a4360b90360309a97e71a06b4cd344c9729 Mon Sep 17 00:00:00 2001 From: Robert Machmer Date: Thu, 24 Dec 2015 03:24:57 +0100 Subject: [PATCH] Add getter which returns a node based on a given id --- fd/Graph.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fd/Graph.lua b/fd/Graph.lua index 193d6da..74368fc 100644 --- a/fd/Graph.lua +++ b/fd/Graph.lua @@ -173,6 +173,13 @@ function Graph.new() func( edges, nodes ); end + --- + -- Returns the node the id is pointing to. + -- param id - The id to check for. + function self:getNode( id ) + return nodes[id]; + end + --- -- Gets a node at a certain point in the graph. -- @param x - The x coordinate to check.