Make Scenery a domain aggregate with no I/O

Parsing and loading move to Infrastructure/Sceneries. Weather becomes a value
object owning the "does this differ from the file" rule.
This commit is contained in:
maj00r
2026-09-04 20:53:50 +02:00
parent a3137a27c4
commit 789f0dd1c9
25 changed files with 1465 additions and 624 deletions

View File

@@ -0,0 +1,22 @@
using StarterNG.Application.Abstractions;
namespace StarterNG.Tests.Fakes;
/// <summary>
/// Randomness pinned to the low end of every range, so weather that varies in
/// production is deterministic in tests.
/// </summary>
public sealed class StubRandom : IRandomSource
{
private readonly int _fixedValue;
public StubRandom(int fixedValue = 0)
{
_fixedValue = fixedValue;
}
public int Next(int minInclusive, int maxExclusive) =>
Math.Clamp(minInclusive + _fixedValue, minInclusive, Math.Max(minInclusive, maxExclusive - 1));
public double NextDouble() => 0.0;
}