mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-13 21:46:58 -08:00
Inject Random into QuadrantInfo
This commit is contained in:
@@ -25,7 +25,7 @@ namespace SuperStarTrek.Space
|
||||
.Select(x => Enumerable
|
||||
.Range(0, 8)
|
||||
.Select(y => new Coordinates(x, y))
|
||||
.Select(c => QuadrantInfo.Create(c, GetQuadrantName(c)))
|
||||
.Select(c => QuadrantInfo.Create(c, GetQuadrantName(c), random))
|
||||
.ToArray())
|
||||
.ToArray();
|
||||
|
||||
|
||||
@@ -19,9 +19,8 @@ namespace SuperStarTrek.Space
|
||||
internal bool HasStarbase { get; private set; }
|
||||
internal int StarCount { get; }
|
||||
|
||||
internal static QuadrantInfo Create(Coordinates coordinates, string name)
|
||||
internal static QuadrantInfo Create(Coordinates coordinates, string name, Random random)
|
||||
{
|
||||
var random = new Random();
|
||||
var klingonCount = random.GetFloat() switch
|
||||
{
|
||||
> 0.98f => 3,
|
||||
|
||||
Reference in New Issue
Block a user