RynthSuite/Tools/RynthCore.LootEditor/SalvageVMs.cs
Tom Bohar 0a4b611a90 RynthSuite as of 2026-09-05 (internal a5ff5c2)
A snapshot of the working tree for aelrynth.com/git/: the code, build files
and public docs. Internal review notes and agent instructions are left out.
MIT licensed; see LICENSE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:23:05 -04:00

51 lines
1.5 KiB
C#

using RynthCore.Loot;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace RynthCore.LootEditor;
/// <summary>One row in the per-material salvage combine table.</summary>
public sealed class SalvagePerMaterialRow : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
private void Notify([CallerMemberName] string? n = null) =>
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(n));
private int _materialId;
public int MaterialId
{
get => _materialId;
set
{
if (_materialId == value) return;
_materialId = value;
_materialName = MaterialTypes.Name(value);
Notify();
Notify(nameof(MaterialName));
}
}
private string _materialName;
public string MaterialName
{
get => _materialName;
private set { _materialName = value; Notify(); }
}
private string _bandsText;
public string BandsText
{
get => _bandsText;
set { if (_bandsText == value) return; _bandsText = value; Notify(); }
}
public SalvagePerMaterialRow(int materialId, string materialName, string bandsText)
{
_materialId = materialId;
_materialName = materialName;
_bandsText = bandsText;
}
}
/// <summary>(id, "id - name") pair shown in the material picker ComboBox.</summary>
public sealed record MaterialOption(int Id, string Display);