Пример #1
0
 public <T extends SceneNodeComponent> void removeComponent(Class<T> componentType) {
   int typeId = ComponentType.findType(componentType);
   SceneNodeComponent component = _components.get(ComponentType.findBaseType(typeId));
   if (component != null && isSubtype(typeId, component.componentType)) {
     component.destroy();
   }
 }
Пример #2
0
 public <T extends SceneNodeComponent> boolean hasComponent(
     Class<T> type, boolean includeInactive) {
   int typeId = ComponentType.findType(type);
   SceneNodeComponent value = _components.get(ComponentType.findBaseType(typeId));
   return value != null
       && (includeInactive || value.isActive())
       && isSubtype(typeId, value.componentType);
 }
Пример #3
0
 public <T extends SceneNodeComponent> T getComponent(int typeId, boolean includeInactive) {
   SceneNodeComponent value = _components.get(ComponentType.findBaseType(typeId));
   return value != null
           && (includeInactive || value.isActive())
           && isSubtype(typeId, value.componentType)
       ? Values.<T>cast(value)
       : null;
 }
Пример #4
0
 public boolean hasComponent(int typeId, boolean includeInactive) {
   SceneNodeComponent value = _components.get(ComponentType.findBaseType(typeId));
   return value != null
       && (includeInactive || value.isActive())
       && isSubtype(typeId, value.componentType);
 }
Пример #5
0
 public void removeComponent(int componentTypeId) {
   SceneNodeComponent component = _components.get(ComponentType.findBaseType(componentTypeId));
   if (component != null && isSubtype(componentTypeId, component.componentType)) {
     component.destroy();
   }
 }