Implements a bunch more moves
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-05-17 17:44:15 +02:00
parent ecabe2fd10
commit a17cb92c5a
62 changed files with 1180 additions and 81 deletions

View File

@@ -46,6 +46,8 @@ public interface IRandom
/// Get a random boolean. 50% chance of being true.
/// </summary>
public bool GetBool();
public T OneOf<T>(IReadOnlyList<T> list);
}
/// <inheritdoc />
@@ -94,4 +96,12 @@ public class RandomImpl : IRandom
/// <inheritdoc />
public bool GetBool() => _random.Next(2) == 1;
/// <inheritdoc />
public T OneOf<T>(IReadOnlyList<T> list)
{
if (list.Count == 0)
throw new ArgumentException("List cannot be empty.", nameof(list));
return list[GetInt(list.Count)];
}
}