Local AI Testing & Interactive Tech Tab

Refactored game loop to allow full local testing
Added AI controller abstractions
Added ability to save database to local copy for offline testing
Tech Tab is now interactive, has properties panel
This commit is contained in:
hyperion51 2020-04-23 03:31:17 +01:00
commit af88788e4f
50 changed files with 5799 additions and 712 deletions

View file

@ -67,8 +67,8 @@ public static class Extensions
}
private static Random? _random;
private static Random Random => (Random) (_random ?? (_random = new Random(1337)));
public static T RandomElement<T>(this IEnumerable<T> enumerable) => enumerable.ElementAt(Random.NextInt(0, enumerable.Count()));
private static Random 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 NextUnbounded(this Random random) => 1 / (1 - random.NextFloat()) - 1;
public static float NextUnbounded(this Random random, float bias, float power) => 1 / (1 - pow(random.NextFloat(), 1 - pow(clamp(bias,0,.99f), 1 / power))) - 1;