Commits

Michael Ludwig  committed ceb5a85

Make Entity comparable by its assigned id.

  • Participants
  • Parent commits eef1b60

Comments (0)

Files changed (1)

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

  * 
  * @author Michael Ludwig
  */
-public final class Entity implements Iterable<Component<?>> {
+public final class Entity implements Iterable<Component<?>>, Comparable<Entity> {
     private final EntitySystem system;
     private final int id;
     
             }
         }
     }
+
+    @Override
+    public int compareTo(Entity o) {
+        return id - o.id;
+    }
 }