Skip to content

five-on-it / packages/sim/src/vehicle / nearestPoint

Function: nearestPoint() ​

nearestPoint(points, x, z, taken?): SpawnPoint

Defined in: packages/sim/src/vehicle.ts:665

The point of a list closest to a position (the first of a non-empty list on a tie) that is not taken (something stands there); the closest of all when every one is.

Parameters ​

points ​

readonly SpawnPoint[]

x ​

number

z ​

number

taken? ​

(p) => boolean

Returns ​

SpawnPoint