NevermoreEngine icon indicating copy to clipboard operation
NevermoreEngine copied to clipboard

Add varargs to maid:GiveTask to support adding multiple tasks at once

Open sayhisam1 opened this issue 5 years ago • 3 comments

Currently, the procedure to add many items to maid is to do a repeated call to GiveTask, like so:

local a = Instance.new("Part") local b = Instance.new("Part") maid:GiveTask(a) maid:GiveTask(b)

I propose adding varargs support to :GiveTask, so that we can simply do: local a = Instance.new("Part") local b = Instance.new("Part") maid:GiveTask(a,b) instead, which is a lot cleaner as it fits in a single line.

sayhisam1 avatar Feb 02 '20 05:02 sayhisam1

For the sake of long-term support, it would probably be wiser to add the ability to provide multiple objects to clean as a table. If we were to add varargs, this could prevent the addition of custom arguments to the GiveTask method later on.

devSparkle avatar Feb 13 '20 13:02 devSparkle

For the sake of long-term support, it would probably be wiser to add the ability to provide multiple objects to clean as a table. If we were to add varargs, this could prevent the addition of custom arguments to the GiveTask method later on.

It would probably be best to have a new method altogether, then - say maid:GiveTasks(...)

sayhisam1 avatar Feb 15 '20 07:02 sayhisam1

I'd be more comfortable with :GiveTasks(), but I'm not entirely sure this is something we want to do. It's really nice to keep the :GiveTask() separate.

Quenty avatar Sep 08 '20 18:09 Quenty