Пример #1
0
 @Override
 public void removeComponent(EntityComponent component) {
   if (components.remove(component)) {
     component.onDetached();
   }
 }
Пример #2
0
 @Override
 public void attachComponent(EntityComponent component) {
   component.attachToEntity(this);
   component.onAttached();
   components.add(new AtomicReference<EntityComponent>(component));
 }