cleanup
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
# Linux-specific instructions
|
# Linux-specific instructions
|
||||||
|
|
||||||
- After every iteration, run `dotnet jb cleanupcode --build=False '$file1' '$file2' ...` for every C# file you touched.
|
- After every iteration, run `dotnet jb cleanupcode --verbosity:ERROR ./ReactorMaintenance.slnx`.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Windows-specific instructions
|
# 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 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.
|
- After every iteration, run `jb cleanupcode --verbosity:ERROR ReactorMaintenance.slnx`.
|
||||||
@@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
public sealed record PropState
|
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 EPropType Type { get; init; }
|
||||||
public ECarrierType Carrier { get; init; }
|
public ECarrierType Carrier { get; init; }
|
||||||
public EPropSwitchState SwitchState { get; init; } = EPropSwitchState.Enabled;
|
public EPropSwitchState SwitchState { get; init; } = EPropSwitchState.Enabled;
|
||||||
@@ -16,14 +26,4 @@ public sealed record PropState
|
|||||||
public EDoorState DoorState { get; init; } = EDoorState.Closed;
|
public EDoorState DoorState { get; init; } = EDoorState.Closed;
|
||||||
|
|
||||||
public bool IsEnabled => SwitchState == EPropSwitchState.Enabled;
|
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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -114,4 +114,4 @@
|
|||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -11,9 +11,9 @@ using System.ComponentModel;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Windows.Foundation;
|
using Windows.Foundation;
|
||||||
using Windows.System;
|
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
using Windows.Storage.Pickers;
|
using Windows.Storage.Pickers;
|
||||||
|
using Windows.System;
|
||||||
using Windows.UI;
|
using Windows.UI;
|
||||||
using Windows.UI.Popups;
|
using Windows.UI.Popups;
|
||||||
using WinRT.Interop;
|
using WinRT.Interop;
|
||||||
@@ -47,10 +47,13 @@ public sealed partial class MainWindow
|
|||||||
|
|
||||||
private sealed class EditorToolViewModel(EditorToolCommand command, string label) : INotifyPropertyChanged
|
private sealed class EditorToolViewModel(EditorToolCommand command, string label) : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
private bool m_IsSelected;
|
|
||||||
|
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
|
|
||||||
|
private void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
||||||
|
{
|
||||||
|
PropertyChanged?.Invoke(this, new(propertyName));
|
||||||
|
}
|
||||||
|
|
||||||
public EditorToolCommand Command { get; } = command;
|
public EditorToolCommand Command { get; } = command;
|
||||||
public string Label { get; } = label;
|
public string Label { get; } = label;
|
||||||
|
|
||||||
@@ -67,10 +70,7 @@ public sealed partial class MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
private bool m_IsSelected;
|
||||||
{
|
|
||||||
PropertyChanged?.Invoke(this, new(propertyName));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
@@ -1017,11 +1017,12 @@ public sealed partial class MainWindow
|
|||||||
private readonly IReadOnlyList<EditorToolViewModel> m_EditorTools = [];
|
private readonly IReadOnlyList<EditorToolViewModel> m_EditorTools = [];
|
||||||
|
|
||||||
private readonly SimulationEngine m_Simulation = new();
|
private readonly SimulationEngine m_Simulation = new();
|
||||||
|
private EEditorLayer m_ActiveLayer = EEditorLayer.Surface;
|
||||||
private StorageFile? m_CurrentFile;
|
private StorageFile? m_CurrentFile;
|
||||||
|
private GridPosition? m_CursorDragStartCell;
|
||||||
private bool m_DragExceededClickThreshold;
|
private bool m_DragExceededClickThreshold;
|
||||||
private CanvasBitmap? m_HeatSprite;
|
private CanvasBitmap? m_HeatSprite;
|
||||||
private EEditorLayer m_ActiveLayer = EEditorLayer.Surface;
|
private bool m_IsPanning;
|
||||||
private GridPosition? m_CursorDragStartCell;
|
|
||||||
private Point m_LastPanPoint;
|
private Point m_LastPanPoint;
|
||||||
private CanvasBitmap? m_LeakSprite;
|
private CanvasBitmap? m_LeakSprite;
|
||||||
private bool m_LeftPointerDown;
|
private bool m_LeftPointerDown;
|
||||||
@@ -1029,7 +1030,6 @@ public sealed partial class MainWindow
|
|||||||
private LevelState m_Level;
|
private LevelState m_Level;
|
||||||
private double m_PanX;
|
private double m_PanX;
|
||||||
private double m_PanY;
|
private double m_PanY;
|
||||||
private bool m_IsPanning;
|
|
||||||
private CanvasBitmap? m_RobotSprite;
|
private CanvasBitmap? m_RobotSprite;
|
||||||
private GridPosition? m_SelectedCell;
|
private GridPosition? m_SelectedCell;
|
||||||
private int? m_SelectedReactorId = 1;
|
private int? m_SelectedReactorId = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user