collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
872 stars 99 forks source link

Networked clients should not require VendorGenerator and ItemGenerator #89

Open collinsmith opened 3 years ago

collinsmith commented 3 years ago

com.riiablo.ai.Npc is generating it's own items and requires VendorGenerator to be injected, which in turn requires ItemGenerator to be injected. This works alright for local instances, but networked clients should not have items generated client-side and should instead have the items injected over the network. Until this time, I have just added local generation, but this should be changed.

Ideally Npc should never generate their own items and this dependency should be resolved. Generation would take place in a server-side system which would generate the Npc inventories when the entities are created.