From 6d9725e825097df0809c0d13f429582a790f891d Mon Sep 17 00:00:00 2001 From: ZHU MINCHAO <48154958+MinchaoZhu@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:20:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8C=89=E9=92=AE=EF=BC=9A?= =?UTF-8?q?=E6=B8=85=E6=A1=8C=E9=9D=A2=E3=80=81=E5=82=A8=E8=97=8F=E5=8C=BA?= =?UTF-8?q?=E4=B8=8E=E6=9C=BA=E5=99=A8=E5=8C=BA=E5=90=84=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E4=B8=80=E5=8D=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- src/Decentralized/ShowcaseCases.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Decentralized/ShowcaseCases.cs b/src/Decentralized/ShowcaseCases.cs index 69579b9..acf2c41 100644 --- a/src/Decentralized/ShowcaseCases.cs +++ b/src/Decentralized/ShowcaseCases.cs @@ -99,14 +99,19 @@ namespace Decentralized Place(item); Log.Info($"展示样例(鉴定){_next}/{All.Count}:{c.Name}"); })); - ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Clear counter + half of storage (test)", () => Log.Guard("清柜台与一半储物", () => + ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Clear desk + half of storage and machine bays (test)", () => Log.Guard("清柜台与一半储物", () => { var e = EmporiumEntry.Instance; int counter = 0, bays = 0; - foreach (var it in e.backInvinvElement.childItems.ToList()) { it.Destroy(); counter++; } - var storage = e.invElement.childItems.Where(i => i.identifier != null && i.identifier.StartsWith("storage_bay")).ToList(); - for (int i = 0; i < storage.Count; i += 2) { storage[i].Destroy(); bays++; } - Log.Info($"清空柜台 {counter} 件;储物箱 {storage.Count} 个里去掉 {bays} 个"); + foreach (var inv in new[] { e.backInvinvElement, e.backInvinvElementCounter, e.frontInvinvElement }) + if (inv != null) foreach (var it in inv.childItems.ToList()) { it.Destroy(); counter++; } + var storage = e.invElement.childItems.Where(i => i.identifier != null && (i.identifier.StartsWith("storage_bay") || i.identifier.StartsWith("machine_bay"))).ToList(); + foreach (var kind in storage.GroupBy(i => i.identifier)) + { + var list = kind.ToList(); + for (int i = 0; i < list.Count; i += 2) { list[i].Destroy(); bays++; } + } + Log.Info($"清空桌面 {counter} 件;储藏区和机器区 {storage.Count} 个里去掉 {bays} 个"); })); ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Paper: dump starters (test)", () => Log.Guard("纸张起点", () => {