JUtils
A unity utilities library
JUtils.Enumerable Class Reference

Extensions for Enumerates More...

Static Public Member Functions

static T Random< T > (this IEnumerable< T > self)
 Get a random element from the enumerable More...
 
static T Random< T > (this IEnumerable< T > self, Random random)
 Get a random element from the enumerable using System.Random More...
 
static int IndexOf< T > (this IEnumerable< T > self, Predicate< T > predicate)
 Get the index of an element More...
 
static int IndexOf< T > (this IEnumerable< T > self, T element)
 Get the index of an element More...
 
static T Nearest< T > (this IEnumerable< T > self, Vector3 position)
 Get the nearest object from a certain position More...
 
static T Furthest< T > (this IEnumerable< T > self, Vector3 position)
 Get the furthest object from a certain position More...
 
static bool TryGet< T > (this IEnumerable< T > self, out T result, Predicate< T > predicate)
 Try get an specific element in the list based on a predicate More...
 

Detailed Description

Extensions for Enumerates

Member Function Documentation

◆ Furthest< T >()

static T JUtils.Enumerable.Furthest< T > ( this IEnumerable< T >  self,
Vector3  position 
)
inlinestatic

Get the furthest object from a certain position

Type Constraints
T :Component 

◆ IndexOf< T >() [1/2]

static int JUtils.Enumerable.IndexOf< T > ( this IEnumerable< T >  self,
Predicate< T >  predicate 
)
inlinestatic

Get the index of an element

◆ IndexOf< T >() [2/2]

static int JUtils.Enumerable.IndexOf< T > ( this IEnumerable< T >  self,
element 
)
inlinestatic

Get the index of an element

Type Constraints
T :class 

◆ Nearest< T >()

static T JUtils.Enumerable.Nearest< T > ( this IEnumerable< T >  self,
Vector3  position 
)
inlinestatic

Get the nearest object from a certain position

Type Constraints
T :Component 

◆ Random< T >() [1/2]

static T JUtils.Enumerable.Random< T > ( this IEnumerable< T >  self)
inlinestatic

Get a random element from the enumerable

◆ Random< T >() [2/2]

static T JUtils.Enumerable.Random< T > ( this IEnumerable< T >  self,
Random  random 
)
inlinestatic

Get a random element from the enumerable using System.Random

◆ TryGet< T >()

static bool JUtils.Enumerable.TryGet< T > ( this IEnumerable< T >  self,
out T  result,
Predicate< T >  predicate 
)
inlinestatic

Try get an specific element in the list based on a predicate


The documentation for this class was generated from the following file: