diff --git a/src/main/java/org/ntlab/acanthus_server/entities/Position.java b/src/main/java/org/ntlab/acanthus_server/entities/Position.java index 89b9b71..3097f20 100644 --- a/src/main/java/org/ntlab/acanthus_server/entities/Position.java +++ b/src/main/java/org/ntlab/acanthus_server/entities/Position.java @@ -6,7 +6,7 @@ import java.util.HashMap; import java.util.UUID; -public class Position { +public class Position implements Comparable { private int i; private float x; private float y; @@ -27,4 +27,15 @@ this.y = y; } + @Override + public int compareTo(Object o) { + if (o instanceof Position) { + if (i < ((Position) o).i) { + return -1; + } else if (i > ((Position) o).i) { + return 1; + } + } + return 0; + } }