public override void ProcessInput(Event ev) { base.ProcessInput(ev); if (transporters == null) { transporters = new List <CompTransporter>(); } if (!transporters.Contains(transComp)) { transporters.Add(transComp); } CompLaunchable launchable = transComp.Launchable; if (launchable != null) { Building fuelingPortSource = launchable.FuelingPortSource; if (fuelingPortSource != null) { Map map = transComp.Map; tmpFuelingPortGivers.Clear(); map.floodFiller.FloodFill(fuelingPortSource.Position, (IntVec3 x) => FuelingPortUtility.AnyFuelingPortGiverAt(x, map), delegate(IntVec3 x) { tmpFuelingPortGivers.Add(FuelingPortUtility.FuelingPortGiverAt(x, map)); }); for (int i = 0; i < transporters.Count; i++) { Building fuelingPortSource2 = transporters[i].Launchable.FuelingPortSource; if (fuelingPortSource2 != null && !tmpFuelingPortGivers.Contains(fuelingPortSource2)) { Messages.Message("MessageTransportersNotAdjacent".Translate(), fuelingPortSource2, MessageTypeDefOf.RejectInput, historical: false); return; } } } } for (int j = 0; j < transporters.Count; j++) { if (transporters[j] != transComp && !transComp.Map.reachability.CanReach(transComp.parent.Position, transporters[j].parent, PathEndMode.Touch, TraverseParms.For(TraverseMode.PassDoors))) { Messages.Message("MessageTransporterUnreachable".Translate(), transporters[j].parent, MessageTypeDefOf.RejectInput, historical: false); return; } } Dialog_LoadTransporters dialog_LoadTransporters = new Dialog_LoadTransporters(transComp.Map, transporters); dialog_LoadTransporters.autoLoot = transComp.Shuttle != null && transComp.Shuttle.CanAutoLoot; Find.WindowStack.Add(dialog_LoadTransporters); }
public override void ProcessInput(Event ev) { base.ProcessInput(ev); if (this.transporters == null) { this.transporters = new List <CompTransporter>(); } if (!this.transporters.Contains(this.transComp)) { this.transporters.Add(this.transComp); } CompLaunchable launchable = this.transComp.Launchable; if (launchable != null) { Building fuelingPortSource = launchable.FuelingPortSource; if (fuelingPortSource != null) { Map map = this.transComp.Map; Command_LoadToTransporter.tmpFuelingPortGivers.Clear(); map.floodFiller.FloodFill(fuelingPortSource.Position, (IntVec3 x) => FuelingPortUtility.AnyFuelingPortGiverAt(x, map), delegate(IntVec3 x) { Command_LoadToTransporter.tmpFuelingPortGivers.Add(FuelingPortUtility.FuelingPortGiverAt(x, map)); }, 2147483647, false, null); for (int i = 0; i < this.transporters.Count; i++) { Building fuelingPortSource2 = this.transporters[i].Launchable.FuelingPortSource; if (fuelingPortSource2 != null && !Command_LoadToTransporter.tmpFuelingPortGivers.Contains(fuelingPortSource2)) { Messages.Message("MessageTransportersNotAdjacent".Translate(), fuelingPortSource2, MessageTypeDefOf.RejectInput); return; } } } } for (int j = 0; j < this.transporters.Count; j++) { if (this.transporters[j] != this.transComp) { if (!this.transComp.Map.reachability.CanReach(this.transComp.parent.Position, this.transporters[j].parent, PathEndMode.Touch, TraverseParms.For(TraverseMode.PassDoors, Danger.Deadly, false))) { Messages.Message("MessageTransporterUnreachable".Translate(), this.transporters[j].parent, MessageTypeDefOf.RejectInput); return; } } } Find.WindowStack.Add(new Dialog_LoadTransporters(this.transComp.Map, this.transporters)); }
public static bool AnyFuelingPortGiverAt(IntVec3 c, Map map) { return(FuelingPortUtility.FuelingPortGiverAt(c, map) != null); }
internal void <> m__1(IntVec3 x) { Command_LoadToTransporter.tmpFuelingPortGivers.Add(FuelingPortUtility.FuelingPortGiverAt(x, this.map)); }