Add function for checking if a node ID already exists

This commit is contained in:
Robert Machmer 2016-01-09 02:02:44 +01:00
parent 3adb350ca3
commit 436ec9f78f

View File

@ -163,6 +163,14 @@ function Graph.new()
func( edges, nodes ); func( edges, nodes );
end end
---
-- Checks if a certain Node ID already exists.
-- @param id - The id to check for.
--
function self:hasNode( id )
return nodes[id] ~= nil;
end
--- ---
-- Returns the node the id is pointing to. -- Returns the node the id is pointing to.
-- @param id - The id to check for. -- @param id - The id to check for.