singleOrNull

inline fun singleOrNull(): Vector2I?

Returns single element, or null if the array is empty or has more than one element.


inline fun singleOrNull(predicate: (Vector2I) -> Boolean): Vector2I?

Returns the single element matching the given predicate, or null if element was not found or more than one element was found.