Asteroids & Refactoring

We have proper belts that hug the Grid, reactive properties for planet instance data, and more!
This commit is contained in:
Reinier Vens 2020-12-01 00:16:11 +00:00
commit 1f90d3639a
42 changed files with 614 additions and 597 deletions

View file

@ -60,7 +60,7 @@ public static class Extensions
}
private static Random? _random;
private static Random Random => (Random) (_random ?? (_random = new Random((uint) (DateTime.Now.Ticks%uint.MaxValue))));
//private static Random Random => (Random) (_random ??= new Random((uint) (DateTime.Now.Ticks%uint.MaxValue)));
// public static T RandomElement<T>(this IEnumerable<T> enumerable) => enumerable.ElementAt(Random.NextInt(0, enumerable.Count()));
public static float NextPowerDistribution(this ref Random random, float min, float max, float exp, float randexp) =>
pow((pow(max, exp + 1) - pow(min, exp + 1)) * pow(random.NextFloat(), randexp) + pow(min, exp + 1), 1 / (exp + 1));