mirror of
https://github.com/rm-code/Graphoon.git
synced 2024-11-16 18:24:22 +00:00
Add setters for replacing the default Edge and Node classes
This can be handy if the user wants to extend the functionality of those classes. They can simply be inherited in a new class with that new class being used in the Graph then.
This commit is contained in:
parent
73b74ca3fe
commit
7901ac1381
16
fd/Graph.lua
16
fd/Graph.lua
@ -242,4 +242,20 @@ function Graph.new()
|
||||
return self;
|
||||
end
|
||||
|
||||
---
|
||||
-- Replaces the default Edge class with a custom one.
|
||||
-- @param class - The custom Edge class to use.
|
||||
--
|
||||
function Graph.setEdgeClass( class )
|
||||
Edge = class;
|
||||
end
|
||||
|
||||
---
|
||||
-- Replaces the default Node class with a custom one.
|
||||
-- @param class - The custom Node class to use.
|
||||
--
|
||||
function Graph.setNodeClass( class )
|
||||
Node = class;
|
||||
end
|
||||
|
||||
return Graph;
|
||||
|
Loading…
Reference in New Issue
Block a user