single

Returns the single element.

Throws

if the array has more than one element.

if the array is empty.


inline fun single(predicate: (Vector2I) -> Boolean): Vector2I

Returns the single element matching the given predicate.

Throws

if the array contains more than one matching element.

if the array contains no element matching the predicate.