Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!
RuneMate will permanently shut down on August 7, 2026
due to events outside our control. You can continue using RuneMate until this date after which it will no longer be available. Thank you to everyone that contributed to RuneMate's success and to the community for the opportunity to serve you all these years.

  • Learn about RuneMate Vault and how its zero knowledge local encryption already protects your sensitive information.
  • Edit or delete your RuneMate account from your Account Settings.
  • All account upgrade subscriptions have been cancelled. No action required.

Implemented Sorting by distance to locatable

Joined
Jun 21, 2014
Messages
350
We have an option to sort gameobjects by distance to the player via .sortByDistance, however there doesn't seem to be an option to sort by distance to another locatable.

So we could do something like:

Code:
GameObjects.newQuery().names("Granite rocks").results().sortByDistanceTo(new Coordinate(x ,y, z)).limit(0, 2);

This would allow us to save a bit of work trying to figure out how to manually sort by distance to a locatable.

@Cloud
 
Joined
Jun 21, 2014
Messages
350
I implemented it, but should it be sortByDistanceTo or sortByDistanceFrom?
We already have nearestTo(), so to keep things routine I would say SortByDistanceTo, but 'From' appears to be the more accurate term when it comes to the dictionary. It's up to you.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
I think I'm going to use the word from because sortByDistanceFrom sounds better (and the reason we use the word to elsewhere is because nearestTo sounds much better than nearestFrom lol)
 
Top