private void UpdateAttachedHoppers(bool lbInput) { int index1 = 0; this.mnTotalHoppers = 0; this.mnNumAttachedValidHoppers = 0; for (int index2 = 0; index2 < 6; ++index2) { this.maAttachedHoppers[index2] = (StorageMachineInterface)null; long x = this.mnX; long y = this.mnY; long z = this.mnZ; if (index2 == 0) { --x; } if (index2 == 1) { ++x; } if (index2 == 2) { --y; } if (index2 == 3) { ++y; } if (index2 == 4) { --z; } if (index2 == 5) { ++z; } Segment segment = this.AttemptGetSegment(x, y, z); if (segment != null) { StorageMachineInterface machineInterface = segment.SearchEntity(x, y, z) as StorageMachineInterface; if (machineInterface != null) { ++this.mnTotalHoppers; eHopperPermissions permissions = machineInterface.GetPermissions(); if (permissions != eHopperPermissions.Locked && (lbInput || permissions != eHopperPermissions.AddOnly) && ((!lbInput || permissions != eHopperPermissions.RemoveOnly) && (!lbInput || !machineInterface.IsFull())) && (lbInput || !machineInterface.IsEmpty())) { this.maAttachedHoppers[index1] = machineInterface; ++index1; } } } } this.mnNumAttachedValidHoppers = index1; }
private void UpdateAttachedHoppers() { for (int index2 = 0; index2 < 6; ++index2) { long x = this.mnX; long y = this.mnY; long z = this.mnZ; if (index2 == 0) { --x; } if (index2 == 1) { ++x; } if (index2 == 2) { --y; } if (index2 == 3) { ++y; } if (index2 == 4) { --z; } if (index2 == 5) { ++z; } Segment segment = this.AttemptGetSegment(x, y, z); if (segment != null) { StorageMachineInterface machineInterface = segment.SearchEntity(x, y, z) as StorageMachineInterface; if (machineInterface != null) { eHopperPermissions permissions = machineInterface.GetPermissions(); if (permissions != eHopperPermissions.Locked && permissions != eHopperPermissions.AddOnly && permissions != eHopperPermissions.RemoveOnly) { this.hopper = machineInterface; } } } } }
public HopperFreightContainer(StorageMachineInterface machine, FreightCartStation station) { this.Machine = machine; this.Station = station; }