Refactor weather system to consolidate weather data handling; remove redundant weather API endpoint and related components, ensuring a single weather reading represents the entire world. Update UI to toggle weather effects and enhance rendering logic for improved visual consistency. Adjust documentation to reflect changes in weather data structure and API responses.

This commit is contained in:
Leonid Pershin
2026-08-17 10:40:52 +03:00
parent c80c9f14e2
commit 062ab497db
22 changed files with 273 additions and 815 deletions
@@ -37,6 +37,34 @@ public sealed class WeatherSystemTests
Assert.NotEqual(0f, anomaly);
}
/// <summary>
/// A system is now a cell on the map rather than the whole sky, so one launched off the edge can drift
/// past without ever being felt. A freshly seeded pool has to be standing over the map, not beside it.
/// </summary>
[Fact]
public void A_seeded_pool_is_actually_over_the_map()
{
var overhead = 0;
for (var seed = 0; seed < 30; seed++)
{
using var world = new EcsWorld();
WeatherSystem.Seed(world.Ecs, ClimateCatalog.HotDesert, 30.05, (ulong)seed, Summer);
Span<PressureSystem> systems = stackalloc PressureSystem[WeatherSystem.MaxSystems];
var count = WeatherSystem.CopySystems(world.Ecs, systems);
for (var i = 0; i < count; i++)
{
var system = systems[i];
if (MathF.Abs(system.X - 0.5f) < 0.8f && MathF.Abs(system.Y - 0.5f) < 0.8f) overhead++;
}
}
// Two systems per desert world over thirty worlds: the great majority must be within reach.
Assert.True(overhead > 45, $"Only {overhead}/60 seeded systems were anywhere near the map.");
}
[Fact]
public void The_same_seed_produces_the_same_sky()
{