From 8146caa558b216b3eb5a066d6f6638a16cc5d92c Mon Sep 17 00:00:00 2001 From: Robert Machmer Date: Sat, 9 Jan 2016 05:10:38 +0100 Subject: [PATCH] Add varargs to the list of parameters a Node can receive --- fd/Graph.lua | 5 +++-- fd/Node.lua | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fd/Graph.lua b/fd/Graph.lua index e7a872b..6b84cb2 100644 --- a/fd/Graph.lua +++ b/fd/Graph.lua @@ -64,9 +64,10 @@ function Graph.new() -- @param y - The y coordinate the Node should be spawned at (optional). -- @param anchor - Wether the node should be locked in place or not (optional). -- - function self:addNode( id, x, y, anchor ) + function self:addNode( id, x, y, anchor, ... ) + print( id, x, y, anchor, parent, path, spritebatch ) assert( not nodes[id], "Node IDs must be unique." ); - nodes[id] = Node.new( id, x, y, anchor ); + nodes[id] = Node.new( id, x, y, anchor, ... ); return nodes[id]; end diff --git a/fd/Node.lua b/fd/Node.lua index c01b685..bd66e20 100644 --- a/fd/Node.lua +++ b/fd/Node.lua @@ -17,7 +17,7 @@ local DEFAULT_MASS = 0.05; -- @param y - The y coordinate the Node should be spawned at (optional). -- @param anchor - Wether the node should be locked in place or not (optional). -- -function Node.new( id, x, y, anchor ) +function Node.new( id, x, y, anchor, ... ) local self = {}; local px, py = x or 0, y or 0;