novelrt / NovelRT

A cross-platform 2D game engine accompanied by a strong toolset for visual novels.
MIT License
183 stars 43 forks source link

`NovelRT::Ecs::Configurator` appears to be missing `WithSystems` overload for `IEcsSystem` implementors. #502

Closed RubyNova closed 1 year ago

RubyNova commented 1 year ago

The Configurator helper class appears to only support the classic std::function<void(TimeStamp, Catalogue)> signature at the moment, but the SystemScheduler has support for also registering IEcsSystem objects. We should extend the Configurator to support this new overload.

potatochick2020 commented 1 year ago

Is that possible to tell the file and the path of the Configurator help class, SystemScheduler , IEcsSystem objects. Thank you.

RubyNova commented 1 year ago

All three headers can be found in this location.

You should not require the source files but in case you do they are located here.

Are you wanting to be assigned this issue?

bjauny commented 1 year ago

I can work on this.

Only point that bugs me is the initialization of the new collection. I understand that the current _systems are setup using the WithSystems but is it necessary add a parameter for the IEcsSystem collection? Are the two types compatible in the same instance?

RubyNova commented 1 year ago

IEcsSystem objects will have to be tracked probably in a new collection of the configurator, and then acted upon accordingly when the actual ECS instance gets fully built.

Both the std::function version and the IEcsSystem version should be able to be used together to register arbitrary functions and actual objects of the IEcsSystem type accordingly - this already works once the SystemScheduler exists, so it's just a case of propagating support for this to the Configurator API.

I hope this answers your question? Please don't hesitate to let me know if I need to reword anything 😅

bjauny commented 1 year ago

OK. I'll submit something and we'll work from there. :)