测试按钮:清桌面、储藏区与机器区各去掉一半

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Sonnet 5.5 committed 2026-11-04 20:20:43 +08:00
1 parent 66b01d5111
commit 6d9725e825
1 file changed
+10 -5
+10 -5
View File
@@ -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("纸张起点", () =>
{