lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Fri, Aug 2, 2019 at 12:14 AM Soni "They/Them" L. wrote:
On 2019-08-01 6:05 p.m., Egor Skriptunoff wrote:
> Could you provide an example to show benefits of traits?
> What kinds of tasks traits solve better than conventional
> 'objects-and-methods' approach?

Inventory may not be self-contained. Inventory could reference another

I recommend reading

I'm aware of entity-component-system approach.
And this is my understanding of how it should be implemented in Lua:
And I don't see how traits could help implementing it.
The best way to implement ECS is "don't use OOP at all".