Don't activate/deactivate/remove entities when not needed

This commit is contained in:
Matt Low 2020-01-31 21:31:33 +04:00
parent b389cb9c2b
commit cc53757a37

View File

@ -39,20 +39,26 @@ public final class Entity {
} }
public void activate() { public void activate() {
if (!active) {
active = true; active = true;
refresh(); refresh();
} }
}
public void deactivate() { public void deactivate() {
if (active) {
active = false; active = false;
refresh(); refresh();
} }
}
public void remove() { public void remove() {
if (!removed) {
removed = true; removed = true;
active = false; active = false;
refresh(); refresh();
} }
}
public Engine getEngine() { public Engine getEngine() {
return this.engine; return this.engine;