This commit is contained in:
2026-05-11 22:38:33 +02:00
parent 0651603fd2
commit 884cc4503f
5 changed files with 23 additions and 23 deletions

View File

@@ -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
};
}
}

View File

@@ -114,4 +114,4 @@
</ScrollViewer>
</Grid>
</Grid>
</Window>
</Window>

View File

@@ -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<EditorToolViewModel> 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;