This commit is contained in:
2025-11-22 16:58:29 +08:00
parent 87076bd957
commit 0536a94b01
11 changed files with 560 additions and 13 deletions

View File

@@ -8,9 +8,10 @@ using UnityEngine;
namespace WulaFallenEmpire
{
public class Building_GlobalWorkTable : Building_WorkTable
public class Building_GlobalWorkTable : Building_WorkTable, IThingHolder
{
public GlobalProductionOrderStack globalOrderStack;
public ThingOwner innerContainer; // 用于存储待上传的原材料
private CompPowerTrader powerComp;
private CompBreakdownable breakdownableComp;
@@ -27,12 +28,14 @@ namespace WulaFallenEmpire
public Building_GlobalWorkTable()
{
globalOrderStack = new GlobalProductionOrderStack(this);
innerContainer = new ThingOwner<Thing>(this, false);
}
public override void ExposeData()
{
base.ExposeData();
Scribe_Deep.Look(ref globalOrderStack, "globalOrderStack", this);
Scribe_Deep.Look(ref innerContainer, "innerContainer", this);
}
public override void SpawnSetup(Map map, bool respawningAfterLoad)
@@ -526,6 +529,17 @@ namespace WulaFallenEmpire
return selectedKind;
}
// IThingHolder 实现
public void GetChildHolders(List<IThingHolder> outChildren)
{
ThingOwnerUtility.AppendThingHoldersFromThings(outChildren, GetDirectlyHeldThings());
}
public ThingOwner GetDirectlyHeldThings()
{
return innerContainer;
}
// 修改 CreateDropPod 方法
private bool CreateDropPod(IntVec3 dropCell, List<Thing> contents)
{