internal BasinInterfaceWrapper(ContinuousCastingBasin te) { basin = te; TotalCapacity = 10000; InventoryExtractionPermitted = true; UsedCapacity = 0; for (int i = 0; i < basin.mItemsStored.Length; i++) { if (basin.mItemsStored[i] != null) { UsedCapacity += basin.mItemsStored[i].GetAmount(); } } RemainingCapacity = TotalCapacity - UsedCapacity; }
public static StorageMachineInterface getStorageHandlerForEntityForBelt(Segment s, long x, long y, long z, ConveyorEntity belt) { SegmentEntity ret = s.SearchEntity(x, y, z); if (belt.mValue == 15) { //Debug.Log("Motor belt at "+new Coordinate(belt)+" is pulling from a "+ret+" at "+new Coordinate(ret)); } if (ret is ContinuousCastingBasin && belt.mValue == 15) //motor belt { ContinuousCastingBasin ccb = ret as ContinuousCastingBasin; ccb = ccb.GetCenter(); return(ccb != null ? new BasinInterfaceWrapper(ccb) : null); } else { return(ret as StorageMachineInterface); } }