Create a method for requesting a distance to target system.
Check Rat's current system. If it has EDSM coords (cache from the data we pull on system change), use that as the origin point.
If EDSM does not have system coords, walk the log backwards (Or store the last X visited systems) until we have a system with coords. Use this coordinate as basis for the estimation. Notify the rat that the distance is approximate. (Stronger warning the further back we had to walk to find a coord)
If walking back X distance doesn't get a distance, stop processing - OR - Give the distance from Fuelum.
With source point in hand, do an EDSM search for the system. If the system has exact coordinates, calculate Vector3D distance from source to destination. Present as distance in LY, and if rat has entered their jump range, an estimated number of jumps.
If system does not have coordinates, start doing searches on nearby systems.
\ For procedurals:
Alrai Sector AB-C D12-3
Alrai Sector AB-C D*-
Alrai Sector AB-C *
Alrai Sector AB *
Alrai Sector *
(Stop processing, give unknown distance)
The EDSM fetches should be kept down by doing just two queries. Specific system, then all systems in Alrai Sector. We cache the results to do the recursive search afterwards.
\ For non-procedural systems, we will most likely have a coordinate, at least in the bubble. Otherwise, uncertainty level gets high, since catalog systems are not necessarily anywhere near each other.
This distance should be reported back to the API in some form. A similar methodology for finding system distance from Fuelum/Sol might be warranted elsewhere in the API/running under Mecha.
Create a method for requesting a distance to target system.
\ For non-procedural systems, we will most likely have a coordinate, at least in the bubble. Otherwise, uncertainty level gets high, since catalog systems are not necessarily anywhere near each other.
This distance should be reported back to the API in some form. A similar methodology for finding system distance from Fuelum/Sol might be warranted elsewhere in the API/running under Mecha.