I think update method in the provider is not useful when you want to update the inventory for certain situations. We should add observer design pattern for the provider.
The pattern is working like when somebody use update method in SmartInventory, notify method in InventoryProvider will run. It will run the update method when it used, not like the old update method(it's working in a scheduler).
update(ImNotSureAboutTheseParameters) method should be added to SmartInventory and notify(Player, InventoryContest) method should be added to InventoryProvider.
I think
update
method in the provider is not useful when you want to update the inventory for certain situations. We should add observer design pattern for the provider.The pattern is working like when somebody use
update
method in SmartInventory,notify
method in InventoryProvider will run. It will run the update method when it used, not like the old update method(it's working in a scheduler).update(ImNotSureAboutTheseParameters)
method should be added to SmartInventory andnotify(Player, InventoryContest)
method should be added to InventoryProvider.