Page 1 of 1

Call LuaLogisticNetwork.get_item_count() without item name

Posted: Wed May 16, 2018 8:08 am
by DARKHAWX
I couldn't quite fit it all within the title but it would be nice to callLuaLogisticNetwork.get_item_count(item, member) withoutspecify an item name. Right now you must specify and item name, it's impossible to get a count of all items only in storage or only in providers. Solution would probably be to switch the order of the parameters and then have a third option for member being "all", or just allow us to pass through either nil or "" as the item parameter.

Re: Call LuaLogisticNetwork.get_item_count() without item name

Posted: Wed May 16, 2018 9:25 am
by betrok
I think it will be better to add an optional member argument for get_contents() instead.

Re: Call LuaLogisticNetwork.get_item_count() without item name

Posted: Wed May 16, 2018 11:50 am
by DARKHAWX
betrok wrote:I think it will be better to add an optional member argument for get_contents() instead.
That is a better idea.

Re: Call LuaLogisticNetwork.get_item_count() without item name

Posted: Mon Jun 25, 2018 4:38 pm
by Rseding91
What's the use case for this? Such a function would be very expensive to call because it's going to have to iterate over every storage entity in the network and count up every item they have.