Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Is there any way to inject service in System or World? #265

Open
rkdrnf opened this issue Oct 12, 2020 · 1 comment
Open

Is there any way to inject service in System or World? #265

rkdrnf opened this issue Oct 12, 2020 · 1 comment

Comments

@rkdrnf
Copy link

rkdrnf commented Oct 12, 2020

Sometimes a system needs to access other services to do the business logic inside execute(). For example, generating auto-incrementing id of a specific component when adding the component in multiple systems.
Is there any way to inject any service into System or World?

@rkdrnf
Copy link
Author

rkdrnf commented Oct 12, 2020

Right after writing this issue I just found that there's attributes parameter in registerSystem and it is passed to init of the system.

It would be better if it has explicit documentation of how to use it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant