From 884cc4503f3028e273f69afcb69229eff1114b07 Mon Sep 17 00:00:00 2001 From: Frank Tovar Date: Mon, 11 May 2026 22:38:33 +0200 Subject: [PATCH] cleanup --- AGENTS.linux.md | 2 +- AGENTS.windows.md | 2 +- .../Models/PropState.cs | 20 +++++++++---------- src/ReactorMaintenance.Win2D/MainWindow.xaml | 2 +- .../MainWindow.xaml.cs | 20 +++++++++---------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/AGENTS.linux.md b/AGENTS.linux.md index 686e35c..ba7bc77 100644 --- a/AGENTS.linux.md +++ b/AGENTS.linux.md @@ -1,3 +1,3 @@ # Linux-specific instructions -- After every iteration, run `dotnet jb cleanupcode --build=False '$file1' '$file2' ...` for every C# file you touched. \ No newline at end of file +- After every iteration, run `dotnet jb cleanupcode --verbosity:ERROR ./ReactorMaintenance.slnx`. \ No newline at end of file diff --git a/AGENTS.windows.md b/AGENTS.windows.md index 4c3509e..0551528 100644 --- a/AGENTS.windows.md +++ b/AGENTS.windows.md @@ -1,4 +1,4 @@ # Windows-specific instructions - After the implementation is finished, run `python D:\Code\crlf.py $file1 $file2 ...` for changed files you recognize, in order to normalize all line endings of all touched files to CRLF. -- After every iteration, run `jb cleanupcode '$file1' '$file2' ...` for every C# file you touched. \ No newline at end of file +- After every iteration, run `jb cleanupcode --verbosity:ERROR ReactorMaintenance.slnx`. \ No newline at end of file diff --git a/src/ReactorMaintenance.Simulation/Models/PropState.cs b/src/ReactorMaintenance.Simulation/Models/PropState.cs index d70447e..08ea865 100644 --- a/src/ReactorMaintenance.Simulation/Models/PropState.cs +++ b/src/ReactorMaintenance.Simulation/Models/PropState.cs @@ -2,6 +2,16 @@ public sealed record PropState { + public EConsumerServiceState ServiceStateFor(ECarrierType carrier) + { + return carrier switch { + ECarrierType.Fuel => FuelServiceState, + ECarrierType.Coolant => CoolantServiceState, + ECarrierType.Electricity => ElectricityServiceState, + _ => EConsumerServiceState.Unknown + }; + } + public EPropType Type { get; init; } public ECarrierType Carrier { get; init; } public EPropSwitchState SwitchState { get; init; } = EPropSwitchState.Enabled; @@ -16,14 +26,4 @@ public sealed record PropState public EDoorState DoorState { get; init; } = EDoorState.Closed; public bool IsEnabled => SwitchState == EPropSwitchState.Enabled; - - public EConsumerServiceState ServiceStateFor(ECarrierType carrier) - { - return carrier switch { - ECarrierType.Fuel => FuelServiceState, - ECarrierType.Coolant => CoolantServiceState, - ECarrierType.Electricity => ElectricityServiceState, - _ => EConsumerServiceState.Unknown - }; - } } \ No newline at end of file diff --git a/src/ReactorMaintenance.Win2D/MainWindow.xaml b/src/ReactorMaintenance.Win2D/MainWindow.xaml index b771e4d..d60904a 100644 --- a/src/ReactorMaintenance.Win2D/MainWindow.xaml +++ b/src/ReactorMaintenance.Win2D/MainWindow.xaml @@ -114,4 +114,4 @@ - + \ No newline at end of file diff --git a/src/ReactorMaintenance.Win2D/MainWindow.xaml.cs b/src/ReactorMaintenance.Win2D/MainWindow.xaml.cs index 10bcde9..d59e4c5 100644 --- a/src/ReactorMaintenance.Win2D/MainWindow.xaml.cs +++ b/src/ReactorMaintenance.Win2D/MainWindow.xaml.cs @@ -11,9 +11,9 @@ using System.ComponentModel; using System.Globalization; using System.Runtime.CompilerServices; using Windows.Foundation; -using Windows.System; using Windows.Storage; using Windows.Storage.Pickers; +using Windows.System; using Windows.UI; using Windows.UI.Popups; using WinRT.Interop; @@ -47,10 +47,13 @@ public sealed partial class MainWindow private sealed class EditorToolViewModel(EditorToolCommand command, string label) : INotifyPropertyChanged { - private bool m_IsSelected; - public event PropertyChangedEventHandler? PropertyChanged; + private void OnPropertyChanged([CallerMemberName] string? propertyName = null) + { + PropertyChanged?.Invoke(this, new(propertyName)); + } + public EditorToolCommand Command { get; } = command; public string Label { get; } = label; @@ -67,10 +70,7 @@ public sealed partial class MainWindow } } - private void OnPropertyChanged([CallerMemberName] string? propertyName = null) - { - PropertyChanged?.Invoke(this, new(propertyName)); - } + private bool m_IsSelected; } public MainWindow() @@ -1017,11 +1017,12 @@ public sealed partial class MainWindow private readonly IReadOnlyList m_EditorTools = []; private readonly SimulationEngine m_Simulation = new(); + private EEditorLayer m_ActiveLayer = EEditorLayer.Surface; private StorageFile? m_CurrentFile; + private GridPosition? m_CursorDragStartCell; private bool m_DragExceededClickThreshold; private CanvasBitmap? m_HeatSprite; - private EEditorLayer m_ActiveLayer = EEditorLayer.Surface; - private GridPosition? m_CursorDragStartCell; + private bool m_IsPanning; private Point m_LastPanPoint; private CanvasBitmap? m_LeakSprite; private bool m_LeftPointerDown; @@ -1029,7 +1030,6 @@ public sealed partial class MainWindow private LevelState m_Level; private double m_PanX; private double m_PanY; - private bool m_IsPanning; private CanvasBitmap? m_RobotSprite; private GridPosition? m_SelectedCell; private int? m_SelectedReactorId = 1;