I also finally got the jump map display to work (thanks TravellerMap!) The code is pretty straight forward - pass in the world object & the jump range and you get a URL back. I do have to replace all spaces with %20. Now that I am thinking about it, I could just return a proper Uri instead of a string...next commit!
public string JumpMapURL(World w, int jump)
{
string sector = App.DB.Sectors.Where(x => x.SectorID == w.SectorID).FirstOrDefault().Name.Replace(" ", "%20");
return string.Format("Https://travellermap.com/api/jumpmap?sector={0}&hex={1}&jump={2}", sector, w.Hex, jump);
}
I also return the trade code in alphabetical order based on the 2 character code.
I can generate the list of worlds within jump range from the downloaded worlds (I cache all sectors & worlds you load in the local DB, and I've code to figure out the worlds based on the hex position).
Still need to plumb in the buttons for searching for cargo, but first I have to figure that part out. And a cargo editor.
No comments:
Post a Comment