-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Moving components instead of duplicating should lift the Clone
/Reflect
requirement
#18079
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
Comments
EntityCloner
instead of cuplicating should lift the clone boundClone
/Reflect
requirement
To give some context about the problem:
However, hooks and observers can move data out of components, so after step 2 we might have invalid component data stored. Instead, the correct way to do it looks something like this:
So the question really is how to design such interface without having to reimplement most of |
I noticed a couple of I think it's possible to clean up a lot of the repetitive |
This change could also require some adjustments on relations. The cloning behavior currently is to skip Relationship(Target) components. If moving becomes unconditional then this could break it, like when moving such a component into an entity where it is already present. |
Does this become easier now that there is a |
Yes, as far as I can see. It would require restructuring the current |
What problem does this solve or what need does it fill?
With
EntityCloner
, one can give an entity the component of another. By default the original entity keeps it's component and this operation requires the component to be clone-able.However, if the component is moved, so the original entity loses the component, this should be no requirement. But it currently is. Move operations just fail silently
(The same effect can be observed with
EntityCloner
)What solution would you like?
Make it possible to move components without them implementing
Clone
norReflect
.Additional context
This was an open todo from @eugineerd, mentioning that it is tricky to not have the component be dropped twice. I just wanted to open this issue so it is written down somewhere.
(Not sure if this is a bug issue or feature request issue)
The text was updated successfully, but these errors were encountered: