mirror of
https://github.com/rm-code/Graphoon.git
synced 2024-11-16 18:24:22 +00:00
Add function for checking if a node with a given id exists
This commit is contained in:
parent
ebb82093fb
commit
729afd59af
@ -155,6 +155,14 @@ function Graph.new()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Checks if the id points to an existing node.
|
||||||
|
-- @param id - The id to check for.
|
||||||
|
--
|
||||||
|
function self:exists( id )
|
||||||
|
return nodes[id] ~= nil;
|
||||||
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- This function receives a single parameter of type function to which it
|
-- This function receives a single parameter of type function to which it
|
||||||
-- will pass the edges and nodes tables. This means the user has to provide
|
-- will pass the edges and nodes tables. This means the user has to provide
|
||||||
|
Loading…
Reference in New Issue
Block a user