poi results now come out sorted by distance

This commit is contained in:
gnembon committed 2020-05-19 18:17:50 -03:00
1 parent 7d1385b7cc
commit 66c222a77a
1 file changed
+1 -1
@@ -510,7 +510,7 @@ public class CarpetExpression
return LazyValue.NULL;
}
Value ret = ListValue.wrap(store.get(condition, pos, (int)radius, status).map( p ->
Value ret = ListValue.wrap(store.get(condition, pos, (int)radius, status).sorted(Comparator.comparingDouble(p -> p.getPos().getSquaredDistance(pos))).map(p ->
ListValue.of(
new StringValue(p.getType().toString()),
new NumericValue(p.getType().getTicketCount() - ((PointOfInterest_scarpetMixin)p).getFreeTickets()),