MCPcopy Create free account
hub / github.com/Neop/mudmap2 / compareTo

Method compareTo

src/main/java/mudmap2/backend/WorldCoordinate.java:124–132  ·  view source on GitHub ↗

Only to test for equality @param t @return

(WorldCoordinate t)

Source from the content-addressed store, hash-verified

122 * @return
123 */
124 @Override
125 public int compareTo(WorldCoordinate t) {
126 final double d = 0.001;
127 if(layer == t.layer && abs(x - t.x) < d && abs(y - t.y) < d)
128 return 0;
129 else if(x*x + y*y > t.x*t.x + t.y*t.y)
130 return 1;
131 else return -1;
132 }
133}

Callers 7

testPushPopPositionMethod · 0.95
testResetHistoryMethod · 0.95
testGetHistoryMethod · 0.95
testGetCoordinateMethod · 0.95
testGetHomeMethod · 0.95
testSetHomeMethod · 0.95
testCompareToMethod · 0.95

Calls

no outgoing calls

Tested by 7

testPushPopPositionMethod · 0.76
testResetHistoryMethod · 0.76
testGetHistoryMethod · 0.76
testGetCoordinateMethod · 0.76
testGetHomeMethod · 0.76
testSetHomeMethod · 0.76
testCompareToMethod · 0.76