removeAll() has no to parameter?

Game development with Board Game Arena Studio
Post Reply
sparr
Posts: 65
Joined: 08 April 2014, 02:12

removeAll() has no to parameter?

Post by sparr »

removeFromStock( type, to )
Remove an item of the specific type from the stock.
"to" is an optional parameter. If "to" contains the ID of an HTML element, the item removed from the stock is slided to this HTML element before it disappear.
removeFromStockById( id, to )
Remove an item with a specific ID from the stock.
"to" is an optional parameter. If "to" contains the ID of an HTML element, the item removed from the stock is slided to this HTML element before it disappear.
removeAll()
Remove all items from the stock.
It would be helpful if removeAll() had an optional 'to' parameter like the other two functions, so we can skip writing things like this:

Code: Select all

        removeFromStock: function( stock, to )
        {
            cards = stock.getAllItems();
            for ( var i in cards )
            {
                stock.removeFromStockById( cards[i].id, to );
            }
        },
Post Reply

Return to “Developers”