refactor(runtime): own world environment state

This commit is contained in:
Erik 2026-07-26 16:45:04 +02:00
parent b972f539f7
commit 902076c0a4
27 changed files with 886 additions and 295 deletions

View file

@ -10,6 +10,39 @@ namespace AcDream.Core.Tests.World;
public sealed class SkyDescLoaderTests
{
[Theory]
[InlineData(20, 10, 0, 16)]
[InlineData(20, 10, 83, 5)]
[InlineData(20, 116, 83, 18)]
[InlineData(20, 127, 359, 4)]
public void DayGroupSelector_MatchesNamedRetailGoldenValues(
int count,
int absoluteYear,
int dayOfYear,
int expected)
{
Assert.Equal(
expected,
SkyDayGroupSelector.SelectIndex(
count,
absoluteYear,
daysPerYear: 360,
dayOfYear));
}
[Fact]
public void DayGroupSelector_ForcedIndexIsExplicitInput()
{
Assert.Equal(
7,
SkyDayGroupSelector.SelectIndex(
20,
absoluteYear: 10,
daysPerYear: 360,
dayOfYear: 0,
forcedIndex: 7));
}
/// <summary>
/// Hand-build a Region with a minimal sky descriptor to feed the
/// loader without needing real dat bytes. The LoadFromRegion