-
Notifications
You must be signed in to change notification settings - Fork 144
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
What is the proper way of checking if the entity is already removed? #245
Comments
You should probably only be iterating over entities within a given Family (usually using some sort of EntitySystem), rather than retaining references to individual entities. It's slow ( |
Not sure if I understand your problem correctly, but entity.isScheduledForRemoval() might be what you are looking for. |
Didn't realize I was using an older version, but in 1.7.0, |
Another example because I am not sure what I'm doing I need someone to confirm this. Assume that I have an array of visions and I want it to be sorted using a comparator, suddenly a vision is removed and then the Ex1:
assume vision is already removed from the engine, but still in the visions, so this will be changed to?
Ex2
|
EntityListener
handles when the entity is added or removed. My problem is when I remove the entity from the engine, while this entity is being used asComponent
owner, it cause ajava.lang.NullPointerException
. I wonder what method to use to check if entity is already removed from the engine.For example:
Question : is there a method like this to check for entity existence? or something better safer to remove entity while is in use.
The text was updated successfully, but these errors were encountered: