NearestCity
Will return the name and location of the closest city to the specified point in space. To do this correctly, you may want to use an algorithm using a PriorityQueue, such as this or this - otherwise, you might not be fast enough.
Parameters (In output order)
- x
- y
Possible <output>
The output will contain one city tag which is the nearest city. This is an example of a city tag:
<city name="city1" x="coordx" y="coordy" color="color1" radius="radius1"/>
Possible <error> types
- mapIsEmpty
<success> Example
<success>
<command name="nearestCity"/>
<parameters>
<x value="1"/>
<y value="2"/>
</parameters>
<output>
<city name="Annapolis" x="20" y="30" color="red" radius="12"/>
</output>
</success>