Commits

Michael Ludwig  committed b3135f4

Update EntitySystem getComponentTypes() to support non-component superclasses as well.

  • Participants
  • Parent commits 98b9f23

Comments (0)

Files changed (2)

File src/main/java/com/lhkbob/entreri/EntitySystem.java

      *
      * @throws NullPointerException if type is null
      */
-    public <T extends Component> Collection<Class<? extends T>> getComponentTypes(Class<T> type);
+    public Collection<Class<?>> getComponentTypes(Class<?> type);
 
     /**
      * Get all Component interfaces currently used by the EntitySystem. If a type has had all of its

File src/main/java/com/lhkbob/entreri/impl/EntitySystemImpl.java

 
     @Override
     @SuppressWarnings({ "rawtypes", "unchecked" })
-    public <T extends Component> Collection<Class<? extends T>> getComponentTypes(Class<T> type) {
+    public Collection<Class<?>> getComponentTypes(Class<?> type) {
         if (type == null) {
             throw new NullPointerException("Type cannot be null");
         }
 
-        List<Class<? extends T>> ids = new ArrayList<>();
+        List<Class<?>> ids = new ArrayList<>();
         for (int i = 0; i < componentRepositories.length; i++) {
             if (componentRepositories[i] != null) {
                 // check the type