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

Make it possible to remove a resource from the ECS and get full ownership of it #359

Closed
yusdacra opened this issue Aug 26, 2020 · 6 comments
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible

Comments

@yusdacra
Copy link

It should be possible to remove a resource from the ECS and get full ownership of it.

@karroffel karroffel added A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible labels Aug 26, 2020
@Telzhaak
Copy link
Contributor

Just out of interest,

what would that be useful for?
Why was it a resource if you plan on taking ownership of it? Does a copy/clone of the information not suffice?

@yusdacra
Copy link
Author

yusdacra commented Sep 2, 2020

Just out of interest,

what would that be useful for?
Why was it a resource if you plan on taking ownership of it? Does a copy/clone of the information not suffice?

I first wanted it so that I could remove a resource a plugin added so that I could add it to my own (related) resource, but figured out I didn't really need to do that. I can't think of any use-case that isn't already solved by other solutions, to be honest.

@chemicstry
Copy link

Even though there may not be use cases for this now, I think this must be supported by the API. Currently resources are insert only with no way to remove them.

One such use case would be a custom rendering system that is inserted into resource and later you would like to move it somewhere else without destroying window.

@MichaelHills
Copy link
Contributor

Would loading different maps with different game modes be another example?

@alice-i-cecile
Copy link
Member

#1478 creates an API for this, but doesn't allow you to hand it off. I think that's worth implementing still.

@cart
Copy link
Member

cart commented Mar 7, 2021

Close by #1525, via world.remove_resource()

@cart cart closed this as completed Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

7 participants