From a3aa67681f9fbf1a2668d0441e601a063830cbf4 Mon Sep 17 00:00:00 2001 From: James Groom Date: Wed, 20 Mar 2024 19:31:34 +0000 Subject: [PATCH] Clean up debug serialisation of `Cell` fixes 2a67cf93e --- src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs index 57fdf31d5f..9184df18a2 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs @@ -41,6 +41,9 @@ namespace BizHawk.Client.EmuHawk return Column.GetHashCode() + RowIndex.GetHashCode(); } + public override string ToString() + => $"Cell(r: {RowIndex?.ToString() ?? "null"}, c: \"{Column?.Name ?? "(no column)"}\")"; + public static bool operator ==(Cell a, Cell b) { return a?.Equals(b) ?? b is null; @@ -101,7 +104,7 @@ namespace BizHawk.Client.EmuHawk var i = _list.BinarySearch(item); if (i >= 0) { - Debug.Assert(false, $"{nameof(CellList)}'s distinctness invariant was almost broken! CellList.Add({(item is null ? "null" : $"Cell(r: {item.RowIndex}, c: \"{item.Column?.Name ?? "(unnamed)"}\")")})"); + Debug.Assert(false, $"{nameof(CellList)}'s distinctness invariant was almost broken! CellList.Add({(item is null ? "null" : item.ToString())})"); return; } _list.Insert(~i, item);