Hi all, this is more of a architectural question, so no code. I am building a game that requires items to be transported from one place to another, and to support that I am making a logistics manager to oversee exchanges between inventories.
There are three types of inventory: Export, Import and ImportExport. Each import inventory has a priority, so the system should fill up the higher priority inventories first.
My question is around the best way to structure this, whilst still allowing the game to run on mobile.
my current approach which works well is for the logistics mamager to receive an event when an inventory changes and then look for logistics solutions. It does this by firstly itterating through the list of Export inventories and finding an Item to export, then itterating through the list of Import inventories and finding a viable location, sorted by priority. This matched pair is then used to create a logistics job.
So two questions:
Is there a better way to do this? Perhaps a ticket is raised when a new export becomes available that the logistics manager responds to?
When I have 20-40 import and export inventories will itterating through all these lists cause performance issues?
Cheers for any help!