示例#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));
 }