Refactor simulation effects and forecast hazards

This commit is contained in:
2026-05-08 21:26:19 +02:00
parent 023d139281
commit 637e9f7fbc
14 changed files with 374 additions and 141 deletions

View File

@@ -0,0 +1,18 @@
namespace ReactorMaintenance.Simulation;
public sealed class PipeBurstHazard : Hazard
{
public override IEnumerable<Forecast> Predict(LevelState level, int turns)
{
for (var y = 0; y < level.Height; y++)
{
for (var x = 0; x < level.Width; x++)
{
var position = new GridPosition(x, y);
var cell = level.GetCell(position);
if (cell is { HasPipe: true, PipeOpen: false, Flow: 0, LeakRate: >= 3 })
yield return new(EFailureKind.PipeBurst, position, turns, $"PIPE BURST PREDICTED AT {x},{y} IN {turns} TURNS");
}
}
}
}