Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean in setttings for unique components to actually be unique #1070

Open
Discipol opened this issue Jul 8, 2023 · 0 comments
Open

Boolean in setttings for unique components to actually be unique #1070

Discipol opened this issue Jul 8, 2023 · 0 comments

Comments

@Discipol
Copy link

Discipol commented Jul 8, 2023

Right now, a unique component is both inside an anonymous entity directly in the context, as in
_contexts.game.ReplaceCheese("Mozarella")
but you can also do
`_contexts.game.CreateEntity().ReplaceCheese("Mozarella")'

My devs, fresh into Entitas, often do the latter when they actually meant the former, causing issues.

I am requesting the ability to have unique component in the context only (possibly as a boolean in Jenny.properties) and NOT inside the entity of that context.

Is it necessary to have them in the entity? No problem, simply reduce the scope of Add, Remove, Replace, Has so it works internally, but publicly, only the context's version are available. Having your cake, and eating it too :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

No branches or pull requests

1 participant