Files
WulaFallenEmpireRW/Source/WulaFallenEmpire/BuildingComp/WULA_Shuttle/PocketSpaceThingHolder.cs
ProjectKoi-Kalo\Kalo 98a0400c78 WulaFallenEmpireSettings.cs - 添加了 public bool enableDebugLogs = false; 字段和保存配置
 WulaLog.cs - 修改了DebugEnabled属性,仅检查enableDebugLogs设置(不检查DevMode)
 WulaFallenEmpireMod.cs - 在DoSettingsWindowContents中添加了UI复选框,显示"Enable Debug Logs"选项
 替换了所有848个Log.Message/Error/Warning调用为WulaLog.Debug()
2025-12-15 13:05:50 +08:00

71 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using Verse;
namespace WulaFallenEmpire
{
/// <summary>
/// 用于武装穿梭机口袋空间的IThingHolder实现与CompTransporter的容器分离
/// </summary>
public class PocketSpaceThingHolder : IThingHolder, IExposable
{
/// <summary>持有的物品容器</summary>
public ThingOwner<Thing> innerContainer;
/// <summary>该容器的拥有者通常是Building_ArmedShuttleWithPocket</summary>
private IThingHolder owner;
/// <summary>实现IThingHolder.ParentHolder属性</summary>
public IThingHolder ParentHolder => owner;
public PocketSpaceThingHolder()
{
innerContainer = new ThingOwner<Thing>(this);
}
public PocketSpaceThingHolder(IThingHolder owner) : this()
{
this.owner = owner;
}
/// <summary>
/// 获取直接持有的物品
/// </summary>
public ThingOwner GetDirectlyHeldThings()
{
return innerContainer;
}
/// <summary>
/// 获取子持有者
/// </summary>
public void GetChildHolders(List<IThingHolder> outChildren)
{
// 目前没有子持有者,留空
}
/// <summary>
/// 通知物品被添加
/// </summary>
public void Notify_ThingAdded(Thing t)
{
// 这里可以添加逻辑来处理物品被添加到口袋空间的情况
WulaLog.Debug($"[WULA] Item {t.LabelCap} added to pocket space container.");
}
/// <summary>
/// 通知物品被移除
/// </summary>
public void Notify_ThingRemoved(Thing t)
{
// 这里可以添加逻辑来处理物品被从口袋空间移除的情况
WulaLog.Debug($"[WULA] Item {t.LabelCap} removed from pocket space container.");
}
public void ExposeData()
{
Scribe_Deep.Look(ref innerContainer, "innerContainer", this);
// owner 通常在构造函数中设置,不需要序列化
}
}
}