package logic;

import java.util.Comparator;

public class UnitComparator implements Comparator<Unit> {

    @Override
    public int compare(Unit arg0, Unit arg1) {
    // TODO: Change this implementation to the one of EventComparator
        if (arg0.IsSameType(arg1)) return 0;

        for (UnitType unt : UnitType.values())
        {
            if (arg0.Is(unt)) return -1;
            else if (arg1.Is(unt)) return 1;
        }
        return 0;
    }

}

@@ -94,19 +94,18 @@
 or%3CUnit%3E
- %7B
 %0A
+%7B
 %0A    @Ov
@@ -159,124 +159,96 @@
 rg1)
- %7B
 %0A    
-// TODO: Change this implementation to the one of EventComparator%0A        if (arg0.IsSameType(arg1)) return 0
+%7B%0A        if (arg0.IsSameType(arg1))%0A            return arg0.GetId() - arg1.GetId()
 ;%0A%0A 
@@ -324,32 +324,48 @@
 f (arg0.Is(unt))
+%0A               
  return -1;%0A    
@@ -394,16 +394,32 @@
 Is(unt))
+%0A               
  return 
@@ -455,11 +455,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

Fix a bug in UnitComparator (enables multiple dragons)