I'd like to change the API a bit. Currently, if a plugin does
I'd like to make two constructors, one with no parameters, and a second with at least one parameter (C++ code):
This would allow us to use the following in the plugins:
The only problem is that this change *could* break code that depends on the (bad) behavior, that items created without a specified count are created empty. I quite doubt there is any such code, but who knows. What do you think, should I change the API?
local Item = cItem(E_ITEM_STICK);the Item is actually empty, because the cItem constructor has a second parameter, "Count", that defaults to 0.
I'd like to make two constructors, one with no parameters, and a second with at least one parameter (C++ code):
/// Constructs an empty cItem object: cItem(void); /// Constructs the specified item, by default 1 piece: cItem(short a_ItemType, char a_ItemCount = 1, short a_ItemDamage = 0);
This would allow us to use the following in the plugins:
local EmptyItem = cItem(); -- Calls the first constructor local OneStick = cItem(E_ITEM_STICK); -- Calls the second constructor local TwoSticks = cItem(E_ITEM_STICK, 2); -- Calls the second constructor local ThreeRedWool = cItem(E_BLOCK_WOOL, 3, E_META_WOOL_RED); -- Calls the second constructor
The only problem is that this change *could* break code that depends on the (bad) behavior, that items created without a specified count are created empty. I quite doubt there is any such code, but who knows. What do you think, should I change the API?