+ comments to the SM.Base

+ Length, Normalize methods for CVectors
This commit is contained in:
Michel Fedde 2020-12-19 20:49:16 +01:00
parent 5d4b360b05
commit 9b917ac181
18 changed files with 248 additions and 33 deletions

View file

@ -84,6 +84,9 @@ namespace SM.Utility
return (float) Randomizer.NextDouble() * (max - min) + min;
}
/// <summary>
/// Gets a random item from the provided list.
/// </summary>
public static TSource GetRandomItem<TSource>(this IList<TSource> list)
{
return list[GetInt(0, list.Count - 1)];