Пример #1
0
 @Override
 public <T extends Event> T send(T event) {
   if (exists()) {
     entityManager.getEventSystem().send(this, event);
   }
   return event;
 }
Пример #2
0
 @Override
 public Iterable<Component> iterateComponents() {
   if (exists()) {
     return entityManager.iterateComponents(getId());
   }
   return Collections.emptyList();
 }
Пример #3
0
 @Override
 public <T extends Component> T addComponent(T component) {
   if (isActive()) {
     return entityManager.addComponent(getId(), component);
   }
   return component;
 }
Пример #4
0
 @Override
 public <T extends Component> T getComponent(Class<T> componentClass) {
   if (exists()) {
     return entityManager.getComponent(getId(), componentClass);
   }
   return null;
 }
Пример #5
0
 @Override
 public boolean hasComponent(Class<? extends Component> component) {
   return exists() && entityManager.hasComponent(getId(), component);
 }
Пример #6
0
 @Override
 public void destroy() {
   if (isActive()) {
     entityManager.destroy(getId());
   }
 }
Пример #7
0
 @Override
 public void saveComponent(Component component) {
   if (isActive()) {
     entityManager.saveComponent(getId(), component);
   }
 }
Пример #8
0
 @Override
 public void removeComponent(Class<? extends Component> componentClass) {
   if (isActive()) {
     entityManager.removeComponent(getId(), componentClass);
   }
 }
Пример #9
0
 @Override
 public boolean isActive() {
   return exists() && entityManager.isActiveEntity(getId());
 }