Location
Represents a location in the map grid. The location is represented by its x, y and z coordinates.
Inheritors
Properties
Functions
Calculates the squared distance between this location and another location. This is useful for comparing distances without the need to calculate the square root. The squared distance is calculated as follows: (x2-x1 )^2 + (y2-y1)^2 + (z2-z1)^2.
Calculates the distance between this location and another location. This is useful for calculating the actual distance between two locations. The distance is calculated as follows: sqrt((x2-x1 )^2 + (y2-y1)^2 + (z2-z1)^2) and therefore yields the exact same result as the square root of distanceSquared.
Modifies this location by applying the given block to it. The block is used to modify the location's x, y and z coordinates. If this location is an instance of MutableLocation, the coordinates will be modified directly. Otherwise, a new instance of ImmutableLocation will be created with the modified coordinates.