Update rewrite docs and cleanup

This commit is contained in:
2026-05-10 18:09:43 +02:00
parent 7ffaa140a8
commit d22c4a7528
51 changed files with 129 additions and 141 deletions

View File

@@ -46,6 +46,13 @@
- Added tests for network-band rules, reactor-ready rules, inventory rules, removal effects, electricity leak access, and invalid rule targets. - Added tests for network-band rules, reactor-ready rules, inventory rules, removal effects, electricity leak access, and invalid rule targets.
- Verified `dotnet test tests/ReactorMaintenance.Simulation.Tests/ReactorMaintenance.Simulation.Tests.csproj` passes after the rule slice: 21 passed. - Verified `dotnet test tests/ReactorMaintenance.Simulation.Tests/ReactorMaintenance.Simulation.Tests.csproj` passes after the rule slice: 21 passed.
- Ran `jb cleanupcode --build=False ...` and `python D:\Code\crlf.py ...` for touched C# files after the rule slice. - Ran `jb cleanupcode --build=False ...` and `python D:\Code\crlf.py ...` for touched C# files after the rule slice.
- Split serializable simulation records and enums from the monolithic `Models.cs` file into individual files under `Models`.
- Moved level creation, grid mutation helpers, surface clamping, grid geometry, and inventory operations out of serializable model records.
- Replaced separate T-junction and cross-junction props/tools with one topology-inferred `Junction` prop and one editor tool.
- Moved junction ratio presets into balancing data.
- Replaced hardcoded `EPairEffect` variants with parameterized surface interaction verbs and balance-owned magnitudes.
- Introduced a small public `SimulationEngine` facade over an internal simulation system implementation.
- Updated design documentation for generic junctions and parameterized surface interactions.
## Current Work ## Current Work
@@ -53,7 +60,7 @@
## Future Work ## Future Work
1. Expand simulation fidelity where the first slice is intentionally simplified: complete pair table coverage and stronger forecast proof cases. 1. Continue splitting the internal simulation system into smaller action, network, consumer, leak, surface interaction, robot safety, reactor, rule, and forecast systems.
2. Add advanced editor workflows for explicit reactor binding selection, explicit door edge selection, electricity wall leak face selection, and rule event authoring. 2. Add advanced editor workflows for explicit reactor binding selection, explicit door edge selection, electricity wall leak face selection, and rule event authoring.
3. Verify and polish the Win2D app on Windows where the XAML compiler can run. 3. Verify and polish the Win2D app on Windows where the XAML compiler can run.
4. Update README and any affected docs to reflect the new schema, .NET target, editor controls, and deterministic defaults. 4. Update README and any affected docs to reflect the new schema, .NET target, editor controls, and deterministic defaults.

View File

@@ -1,4 +1,4 @@
# Reactor Maintenance Design # Reactor Maintenance Design
## Concept ## Concept
@@ -114,8 +114,7 @@ Surface prop categories:
- flow prop - flow prop
- consumer prop - consumer prop
- T-junction prop - junction prop
- cross-junction prop
- door prop - door prop
- all-seeing-eye terminal prop - all-seeing-eye terminal prop
- remedy supply prop - remedy supply prop
@@ -155,24 +154,9 @@ The level is invalid if any binding is missing, out of bounds, or points to the
A junction prop must be on a floor cell whose coordinate has exactly one underground carrier. That carrier is the regulated network. A junction prop must be on a floor cell whose coordinate has exactly one underground carrier. That carrier is the regulated network.
T-junction modes: The engine infers incoming and outgoing branch directions from valid network topology and enabled source paths. A valid junction has one incoming branch and either two or three outgoing branches. Ambiguous junction flow is invalid. Ratio numbers are balance-defined weights that divide carrier amount and pressure or voltage. A zero-weight branch receives no intentional outflow.
- `0/4` The gameplay UI exposes a single junction tool and cycles through balance-defined ratio presets for the inferred outgoing branch count.
- `1/3`
- `2/2`
- `3/1`
- `4/0`
Cross-junction modes:
- `0/3/3`
- `3/0/3`
- `3/3/0`
- `2/2/2`
The engine infers incoming and outgoing branch directions from valid network topology and enabled source paths. Ambiguous junction flow is invalid. Ratio numbers are weights that divide carrier amount and pressure or voltage by balance-defined math. A zero-weight branch receives no intentional outflow.
The gameplay UI exposes ratio modes.
### Doors ### Doors
@@ -284,33 +268,28 @@ Balance thresholds project numeric values into safe, caution, and critical bands
The pair table maps projected bands to deterministic effects: The pair table maps projected bands to deterministic effects:
- `Hold`: no direct change. - `Hold`: no direct change.
- `FuelFlow`: equalize leaked fuel. The pair table maps projected bands to parameterized verbs:
- `CoolFlow`: equalize leaked coolant.
- `ChargeFlow`: equalize leaked electricity. - `Hold`: no direct change.
- `HeatFlow`: transfer heat. - `Flow(amount)`: equalize a surface quantity by a balance-defined transfer amount.
- `HeatFlow2`: stronger heat transfer. - `Warm(amount)`: increase heat by a balance-defined amount.
- `Warm1`: small heat increase from fuel exposure. - `Quench(amount)`: reduce heat by a balance-defined amount.
- `Warm2`: larger heat increase from fuel exposure. - `Short(heat, discharge)`: add heat and discharge electricity by balance-defined amounts.
- `Quench1`: small heat reduction from coolant exposure. - `Ignite(heat, fuel)`: add heat and consume fuel by balance-defined amounts.
- `Quench2`: larger heat reduction from coolant exposure.
- `Short1`: electricity and coolant interaction causing heat and discharge.
- `Short2`: stronger short.
- `Ignite1`: fuel interaction with electricity or high heat.
- `Ignite2`: stronger ignition.
| Row\Col | FuelSafe | FuelCaution | FuelCritical | CoolantSafe | CoolantCaution | CoolantCritical | ElectricitySafe | ElectricityCaution | ElectricityCritical | HeatSafe | HeatCaution | HeatCritical | | Row\Col | FuelSafe | FuelCaution | FuelCritical | CoolantSafe | CoolantCaution | CoolantCritical | ElectricitySafe | ElectricityCaution | ElectricityCritical | HeatSafe | HeatCaution | HeatCritical |
| ------- | -------- | ----------- | ------------ | ----------- | -------------- | --------------- | --------------- | ------------------ | ------------------- | -------- | ----------- | ------------ | | ------- | -------- | ----------- | ------------ | ----------- | -------------- | --------------- | --------------- | ------------------ | ------------------- | -------- | ----------- | ------------ |
| FuelSafe | Hold | FuelFlow | FuelFlow | Hold | Hold | Hold | Hold | Warm1 | Warm2 | Hold | Warm1 | Warm2 | | FuelSafe | Hold | Flow | Flow | Hold | Hold | Hold | Hold | Warm | Ignite | Hold | Warm | Ignite |
| FuelCaution | | Hold | FuelFlow | Hold | Hold | Hold | Warm1 | Ignite1 | Ignite2 | Warm1 | Ignite1 | Ignite2 | | FuelCaution | | Hold | Flow | Hold | Hold | Hold | Warm | Ignite | Ignite | Warm | Ignite | Ignite |
| FuelCritical | | | Hold | Hold | Hold | Hold | Warm2 | Ignite2 | Ignite2 | Warm2 | Ignite2 | Ignite2 | | FuelCritical | | | Hold | Hold | Hold | Hold | Ignite | Ignite | Ignite | Ignite | Ignite | Ignite |
| CoolantSafe | | | | Hold | CoolFlow | CoolFlow | Hold | Short1 | Short2 | Hold | Quench1 | Quench1 | | CoolantSafe | | | | Hold | Flow | Flow | Hold | Short | Short | Hold | Quench | Quench |
| CoolantCaution | | | | | Hold | CoolFlow | Short1 | Short1 | Short2 | Hold | Quench1 | Quench2 | | CoolantCaution | | | | | Hold | Flow | Short | Short | Short | Hold | Quench | Quench |
| CoolantCritical | | | | | | Hold | Short2 | Short2 | Short2 | Hold | Quench2 | Quench2 | | CoolantCritical | | | | | | Hold | Short | Short | Short | Hold | Quench | Quench |
| ElectricitySafe | | | | | | | Hold | ChargeFlow | ChargeFlow | Hold | Hold | Hold | | ElectricitySafe | | | | | | | Hold | Flow | Flow | Hold | Hold | Hold |
| ElectricityCaution | | | | | | | | Hold | ChargeFlow | Hold | Hold | Hold | | ElectricityCaution | | | | | | | | Hold | Flow | Hold | Hold | Hold |
| ElectricityCritical | | | | | | | | | Hold | Hold | Hold | Hold | | ElectricityCritical | | | | | | | | | Hold | Hold | Hold | Hold |
| HeatSafe | | | | | | | | | | Hold | HeatFlow | HeatFlow2 | | HeatSafe | | | | | | | | | | Hold | Flow | Flow |
| HeatCaution | | | | | | | | | | | Hold | HeatFlow | | HeatCaution | | | | | | | | | | | Hold | Flow |
| HeatCritical | | | | | | | | | | | | Hold | | HeatCritical | | | | | | | | | | | | Hold |
Design rules: Design rules:
@@ -422,7 +401,7 @@ The editor authors:
- underground fuel, coolant, and electricity cells - underground fuel, coolant, and electricity cells
- flow props and consumer props - flow props and consumer props
- reactor controls and reactor consumer bindings - reactor controls and reactor consumer bindings
- junction props and ratio modes - junction props and balance-defined ratio mode index
- door props and door edges - door props and door edges
- all-seeing-eye terminals - all-seeing-eye terminals
- remedy supplies - remedy supplies

View File

@@ -1,4 +1,4 @@
using ReactorMaintenance.Simulation.Difficulties; using ReactorMaintenance.Simulation.Difficulties;
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
@@ -158,4 +158,4 @@ public abstract class Balancing
public abstract int RemedyBlockTurns { get; } public abstract int RemedyBlockTurns { get; }
public abstract int HeatShieldSteps { get; } public abstract int HeatShieldSteps { get; }
public abstract int InventoryCapacityPerRemedy { get; } public abstract int InventoryCapacityPerRemedy { get; }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation.Difficulties; namespace ReactorMaintenance.Simulation.Difficulties;
public class NormalBalancing : Balancing public class NormalBalancing : Balancing
{ {
@@ -30,6 +30,7 @@ public class NormalBalancing : Balancing
public override float SourceIntensity => 8; public override float SourceIntensity => 8;
public override float DistanceAmountFalloff => 0.5f; public override float DistanceAmountFalloff => 0.5f;
public override float DistanceIntensityFalloff => 0.4f; public override float DistanceIntensityFalloff => 0.4f;
public override IReadOnlyList<JunctionRatioPreset> TwoOutflowJunctionRatios { get; } = [ public override IReadOnlyList<JunctionRatioPreset> TwoOutflowJunctionRatios { get; } = [
new("0/4", [0, 1]), new("0/4", [0, 1]),
new("1/3", [0.25f, 0.75f]), new("1/3", [0.25f, 0.75f]),
@@ -37,12 +38,14 @@ public class NormalBalancing : Balancing
new("3/1", [0.75f, 0.25f]), new("3/1", [0.75f, 0.25f]),
new("4/0", [1, 0]) new("4/0", [1, 0])
]; ];
public override IReadOnlyList<JunctionRatioPreset> ThreeOutflowJunctionRatios { get; } = [ public override IReadOnlyList<JunctionRatioPreset> ThreeOutflowJunctionRatios { get; } = [
new("0/3/3", [0, 0.5f, 0.5f]), new("0/3/3", [0, 0.5f, 0.5f]),
new("3/0/3", [0.5f, 0, 0.5f]), new("3/0/3", [0.5f, 0, 0.5f]),
new("3/3/0", [0.5f, 0.5f, 0]), new("3/3/0", [0.5f, 0.5f, 0]),
new("2/2/2", [1f / 3f, 1f / 3f, 1f / 3f]) new("2/2/2", [1f / 3f, 1f / 3f, 1f / 3f])
]; ];
public override float ConsumerRequiredAmount => 2.5f; public override float ConsumerRequiredAmount => 2.5f;
public override float ConsumerRequiredIntensity => 2.5f; public override float ConsumerRequiredIntensity => 2.5f;
public override float LeakBaseAmount => 0.5f; public override float LeakBaseAmount => 0.5f;
@@ -64,4 +67,4 @@ public class NormalBalancing : Balancing
public override int RemedyBlockTurns => 2; public override int RemedyBlockTurns => 2;
public override int HeatShieldSteps => 3; public override int HeatShieldSteps => 3;
public override int InventoryCapacityPerRemedy => 3; public override int InventoryCapacityPerRemedy => 3;
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public static class GridPositionExtensions public static class GridPositionExtensions
{ {
@@ -14,4 +14,4 @@ public static class GridPositionExtensions
{ {
return Math.Abs(position.X - other.X) + Math.Abs(position.Y - other.Y); return Math.Abs(position.X - other.X) + Math.Abs(position.Y - other.Y);
} }
} }

View File

@@ -31,4 +31,4 @@ public sealed record JunctionFlow
return -1; return -1;
} }
} }

View File

@@ -94,4 +94,4 @@ public static class JunctionFlowAnalyzer
} }
private sealed record SourceBranch(GridPosition Position, int? Distance); private sealed record SourceBranch(GridPosition Position, int? Distance);
} }

View File

@@ -1,3 +1,3 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record JunctionRatioPreset(string Label, float[] Weights); public sealed record JunctionRatioPreset(string Label, float[] Weights);

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum EEditorTool public enum EEditorTool
{ {
@@ -160,4 +160,4 @@ public static class LevelEditor
] ]
}; };
} }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public static class LevelStateExtensions public static class LevelStateExtensions
{ {
@@ -113,4 +113,4 @@ public static class LevelStateExtensions
{ {
return edgeA == a && edgeB == b || edgeA == b && edgeB == a; return edgeA == a && edgeB == b || edgeA == b && edgeB == a;
} }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public static class LevelStateFactory public static class LevelStateFactory
{ {
@@ -51,4 +51,4 @@ public static class LevelStateFactory
{ {
return Enumerable.Range(0, width * height).Select(_ => new PropState()).ToArray(); return Enumerable.Range(0, width * height).Select(_ => new PropState()).ToArray();
} }
} }

View File

@@ -1,8 +1,8 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record DoorState public sealed record DoorState
{ {
public GridPosition A { get; init; } = new(0, 0); public GridPosition A { get; init; } = new(0, 0);
public GridPosition B { get; init; } = new(0, 0); public GridPosition B { get; init; } = new(0, 0);
public EDoorState State { get; init; } = EDoorState.Closed; public EDoorState State { get; init; } = EDoorState.Closed;
} }

View File

@@ -1,8 +1,8 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum EBand public enum EBand
{ {
Safe, Safe,
Caution, Caution,
Critical Critical
} }

View File

@@ -1,8 +1,8 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ECarrierType public enum ECarrierType
{ {
Fuel, Fuel,
Coolant, Coolant,
Electricity Electricity
} }

View File

@@ -1,7 +1,7 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ECellTerrain public enum ECellTerrain
{ {
Floor, Floor,
Wall Wall
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum EConsumerServiceState public enum EConsumerServiceState
{ {
@@ -7,4 +7,4 @@ public enum EConsumerServiceState
Starved, Starved,
Supplied, Supplied,
Producing Producing
} }

View File

@@ -1,7 +1,7 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum EDoorState public enum EDoorState
{ {
Open, Open,
Closed Closed
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum EForecastKind public enum EForecastKind
{ {
@@ -7,4 +7,4 @@ public enum EForecastKind
ConsumerStarved, ConsumerStarved,
HazardGrowth, HazardGrowth,
RuleEvent RuleEvent
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ELevelState public enum ELevelState
{ {
@@ -8,4 +8,4 @@ public enum ELevelState
Ready, Ready,
Lost, Lost,
Won Won
} }

View File

@@ -1,7 +1,7 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ENetworkValueKind public enum ENetworkValueKind
{ {
Amount, Amount,
Intensity Intensity
} }

View File

@@ -1,7 +1,7 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum EPropSwitchState public enum EPropSwitchState
{ {
Disabled, Disabled,
Enabled Enabled
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum EPropType public enum EPropType
{ {
@@ -10,4 +10,4 @@ public enum EPropType
AllSeeingEyeTerminal, AllSeeingEyeTerminal,
RemedySupply, RemedySupply,
ReactorControl ReactorControl
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ERemedyType public enum ERemedyType
{ {
@@ -6,4 +6,4 @@ public enum ERemedyType
CoolantNeutralizer, CoolantNeutralizer,
ElectricityNeutralizer, ElectricityNeutralizer,
HeatShield HeatShield
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ERuleEffectKind public enum ERuleEffectKind
{ {
@@ -15,4 +15,4 @@ public enum ERuleEffectKind
RemoveInventory, RemoveInventory,
MarkTerminalLoss, MarkTerminalLoss,
EmitWarning EmitWarning
} }

View File

@@ -1,7 +1,7 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ERuleEventPhase public enum ERuleEventPhase
{ {
StartOfSimulation, StartOfSimulation,
EndOfTurn EndOfTurn
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ERulePredicateKind public enum ERulePredicateKind
{ {
@@ -14,4 +14,4 @@ public enum ERulePredicateKind
RobotAt, RobotAt,
RobotInventoryAtLeast, RobotInventoryAtLeast,
AllSeeingEyeUnlocked AllSeeingEyeUnlocked
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ESurfaceInteractionVerb public enum ESurfaceInteractionVerb
{ {
@@ -8,4 +8,4 @@ public enum ESurfaceInteractionVerb
Quench, Quench,
Short, Short,
Ignite Ignite
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum ESurfaceQuantity public enum ESurfaceQuantity
{ {
@@ -6,4 +6,4 @@ public enum ESurfaceQuantity
Coolant, Coolant,
Electricity, Electricity,
Heat Heat
} }

View File

@@ -1,8 +1,8 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public enum EUndergroundState public enum EUndergroundState
{ {
Absent, Absent,
Intact, Intact,
Leaking Leaking
} }

View File

@@ -1,3 +1,3 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record Forecast(EForecastKind Kind, GridPosition? Position, int Turns, string Message); public sealed record Forecast(EForecastKind Kind, GridPosition? Position, int Turns, string Message);

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record GlobalState public sealed record GlobalState
{ {
@@ -9,4 +9,4 @@ public sealed record GlobalState
public bool AllSeeingEyeUnlocked { get; init; } public bool AllSeeingEyeUnlocked { get; init; }
public bool TerminalLoss { get; init; } public bool TerminalLoss { get; init; }
public IReadOnlyList<string> Warnings { get; init; } = Array.Empty<string>(); public IReadOnlyList<string> Warnings { get; init; } = Array.Empty<string>();
} }

View File

@@ -1,3 +1,3 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record GridPosition(int X, int Y); public sealed record GridPosition(int X, int Y);

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record LeakState public sealed record LeakState
{ {
@@ -6,4 +6,4 @@ public sealed record LeakState
public GridPosition UndergroundPosition { get; init; } = new(0, 0); public GridPosition UndergroundPosition { get; init; } = new(0, 0);
public GridPosition AccessPosition { get; init; } = new(0, 0); public GridPosition AccessPosition { get; init; } = new(0, 0);
public bool Repaired { get; init; } public bool Repaired { get; init; }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record LevelState public sealed record LevelState
{ {
@@ -23,4 +23,4 @@ public sealed record LevelState
public RobotState Robot { get; init; } = new(); public RobotState Robot { get; init; } = new();
public GlobalState Global { get; init; } = new(); public GlobalState Global { get; init; } = new();
public IReadOnlyList<Forecast> Forecasts { get; init; } = Array.Empty<Forecast>(); public IReadOnlyList<Forecast> Forecasts { get; init; } = Array.Empty<Forecast>();
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record PropState public sealed record PropState
{ {
@@ -12,4 +12,4 @@ public sealed record PropState
public int ReactorId { get; init; } public int ReactorId { get; init; }
public bool IsEnabled => SwitchState == EPropSwitchState.Enabled; public bool IsEnabled => SwitchState == EPropSwitchState.Enabled;
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record ReactorBinding public sealed record ReactorBinding
{ {
@@ -9,4 +9,4 @@ public sealed record ReactorBinding
public GridPosition ElectricityConsumerPosition { get; init; } = new(0, 0); public GridPosition ElectricityConsumerPosition { get; init; } = new(0, 0);
public bool Ready { get; init; } public bool Ready { get; init; }
public bool Activated { get; init; } public bool Activated { get; init; }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record RobotState public sealed record RobotState
{ {
@@ -8,4 +8,4 @@ public sealed record RobotState
public int ElectricityNeutralizers { get; init; } public int ElectricityNeutralizers { get; init; }
public int HeatShields { get; init; } public int HeatShields { get; init; }
public int HeatImmunitySteps { get; init; } public int HeatImmunitySteps { get; init; }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record RuleEffect public sealed record RuleEffect
{ {
@@ -10,4 +10,4 @@ public sealed record RuleEffect
public float Amount { get; init; } public float Amount { get; init; }
public EPropSwitchState PropSwitchState { get; init; } public EPropSwitchState PropSwitchState { get; init; }
public string Message { get; init; } = string.Empty; public string Message { get; init; } = string.Empty;
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record RuleEventState public sealed record RuleEventState
{ {
@@ -11,4 +11,4 @@ public sealed record RuleEventState
public IReadOnlyList<RulePredicate> Predicates { get; init; } = Array.Empty<RulePredicate>(); public IReadOnlyList<RulePredicate> Predicates { get; init; } = Array.Empty<RulePredicate>();
public IReadOnlyList<RuleEffect> Effects { get; init; } = Array.Empty<RuleEffect>(); public IReadOnlyList<RuleEffect> Effects { get; init; } = Array.Empty<RuleEffect>();
public string ForecastText { get; init; } = string.Empty; public string ForecastText { get; init; } = string.Empty;
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record RulePredicate public sealed record RulePredicate
{ {
@@ -15,4 +15,4 @@ public sealed record RulePredicate
public EBand Band { get; init; } public EBand Band { get; init; }
public int InventoryCount { get; init; } public int InventoryCount { get; init; }
public bool BoolValue { get; init; } public bool BoolValue { get; init; }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record SurfaceState public sealed record SurfaceState
{ {
@@ -9,4 +9,4 @@ public sealed record SurfaceState
public int FuelBlockTurns { get; init; } public int FuelBlockTurns { get; init; }
public int CoolantBlockTurns { get; init; } public int CoolantBlockTurns { get; init; }
public int ElectricityBlockTurns { get; init; } public int ElectricityBlockTurns { get; init; }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record UndergroundCell public sealed record UndergroundCell
{ {
@@ -8,4 +8,4 @@ public sealed record UndergroundCell
public bool IsPresent => State != EUndergroundState.Absent; public bool IsPresent => State != EUndergroundState.Absent;
public bool CarriesFlow => State is EUndergroundState.Intact or EUndergroundState.Leaking; public bool CarriesFlow => State is EUndergroundState.Intact or EUndergroundState.Leaking;
} }

View File

@@ -1,3 +1,3 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record ValidationIssue(string Message, GridPosition? Position = null); public sealed record ValidationIssue(string Message, GridPosition? Position = null);

View File

@@ -1,8 +1,8 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record ValidationReport public sealed record ValidationReport
{ {
public IReadOnlyList<ValidationIssue> Errors { get; init; } = Array.Empty<ValidationIssue>(); public IReadOnlyList<ValidationIssue> Errors { get; init; } = Array.Empty<ValidationIssue>();
public IReadOnlyList<ValidationIssue> Warnings { get; init; } = Array.Empty<ValidationIssue>(); public IReadOnlyList<ValidationIssue> Warnings { get; init; } = Array.Empty<ValidationIssue>();
public bool IsValid => Errors.Count == 0; public bool IsValid => Errors.Count == 0;
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public static class RobotStateExtensions public static class RobotStateExtensions
{ {
@@ -33,4 +33,4 @@ public static class RobotStateExtensions
{ {
return Math.Clamp(value, 0, Balancing.Current.InventoryCapacityPerRemedy); return Math.Clamp(value, 0, Balancing.Current.InventoryCapacityPerRemedy);
} }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed class SimulationEngine public sealed class SimulationEngine
{ {
@@ -43,4 +43,4 @@ public sealed class SimulationEngine
} }
private readonly SimulationCoreSystem m_Core = new(); private readonly SimulationCoreSystem m_Core = new();
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public sealed record SurfaceInteractionEffect public sealed record SurfaceInteractionEffect
{ {
@@ -8,4 +8,4 @@ public sealed record SurfaceInteractionEffect
public ESurfaceQuantity Quantity { get; init; } public ESurfaceQuantity Quantity { get; init; }
public float Amount { get; init; } public float Amount { get; init; }
public float SecondaryAmount { get; init; } public float SecondaryAmount { get; init; }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
public static class SurfaceStateExtensions public static class SurfaceStateExtensions
{ {
@@ -25,4 +25,4 @@ public static class SurfaceStateExtensions
_ => throw new ArgumentOutOfRangeException(nameof(carrier), carrier, "Unsupported carrier.") _ => throw new ArgumentOutOfRangeException(nameof(carrier), carrier, "Unsupported carrier.")
}; };
} }
} }

View File

@@ -1,4 +1,4 @@
namespace ReactorMaintenance.Simulation; namespace ReactorMaintenance.Simulation;
internal sealed class SimulationCoreSystem internal sealed class SimulationCoreSystem
{ {
@@ -703,5 +703,4 @@ internal sealed class SimulationCoreSystem
} }
private readonly LevelValidator m_Validator = new(); private readonly LevelValidator m_Validator = new();
} }

View File

@@ -1,4 +1,4 @@
using Microsoft.Graphics.Canvas; using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Text; using Microsoft.Graphics.Canvas.Text;
using Microsoft.Graphics.Canvas.UI.Xaml; using Microsoft.Graphics.Canvas.UI.Xaml;
using Microsoft.UI; using Microsoft.UI;
@@ -717,4 +717,4 @@ public sealed partial class MainWindow
private CanvasBitmap? m_RobotSprite; private CanvasBitmap? m_RobotSprite;
private CanvasBitmap? m_LeakSprite; private CanvasBitmap? m_LeakSprite;
private CanvasBitmap? m_HeatSprite; private CanvasBitmap? m_HeatSprite;
} }

View File

@@ -405,4 +405,4 @@ public sealed class SimulationEngineTests
} }
private readonly SimulationEngine m_Engine = new(); private readonly SimulationEngine m_Engine = new();
} }