@Override public void removeComponent(EntityComponent component) { if (components.remove(component)) { component.onDetached(); } }
@Override public void attachComponent(EntityComponent component) { component.attachToEntity(this); component.onAttached(); components.add(new AtomicReference<EntityComponent>(component)); }