Closed imthatgin closed 4 months ago
Thanks for the great suggestion. The idea using ECS architecture in the server code sounds really interesting. I wanted to do some experiments.
Donburi uses ebitengine's *ebiten.Image
in the ecs package.
I think that all of those parameters of *ebiten.Image
can be replaced with Generics type parameter.
Then we can remove the dependency to ebitengine from go.mod
. What do you think?
That sounds like a good solution! Would make the ECS system more capable for different contexts!
Thanks! Let's do it.
Some places will be challenging to replace, as struct methods cannot have generic parameters. Do you have any ideas for any alternative solutions?
I understand that it's a bit challenging, but still I think it's possible. Pls give me a moment to try it.
--edit--
Hmm... it seems it's only possible via reflection or completely changing the interface of ecs
package.
Let me try with reflection.
@im-gin I have just managed to remove the dependency to Ebitengine by using reflection, and tagged it as v1.3.13. Please let me know if you find any problems or further suggestions. Thanks!
I have a single go module which contains both client and server code. I want to be able to use the ECS, without necessarily running it in a window.
Therefore, I'd like to request the addition of a compile flag to disable the ebiten dependency if possible.
I get something like this, because the server does not have a display: