Open merlindorin opened 2 years ago
Yeah, one thing I don't like about the add by interface method is how bad that looks. The good news is that go 1.18 is adding generics, which will provide a way to do all the add by interface stuff without all the current complexity. I'll probably end up doing something like AddGenericSystem(s System)
that will hopefully end up replacing all that with just a single line.
Hi, thanks for all your work, having a lot of fun here using ecs & engo :)
One of the most boring, mistakable, and kind of dirty stuff is the registering process of a system.
Usually, we go to a code like that:
I would like to add a method to World in order to simplify this process (before, just an idea, can PR a complete work):
The idea is to delegate the registration process to the system... this can be done in multiple ways like above. Another interesting way can be done by using directly the method "AutoRegister" on the system but I think it's better to define an interface and delegate the registration to World.
This is what I currently do (with a decorator but the idea is here).
Feedback appreciated