Пример #1
0
 public override void CompTick()
 {
     if (PowerOn != curSignal)
     {
         parent.BroadcastCompSignal(PowerOn ? CompSignals.PowerTurnedOn : CompSignals.PowerTurnedOff);
         curSignal = PowerOn;
     }
     if (!PowerOn && Find.TickManager.TicksGame % tickInterval == this.HashCodeToMod(tickInterval))
     {
         var comp = ActiveTerrainUtility.TryFindNearestPowerConduitFloor(parent.Position, parent.Map);
         if (comp != null)
         {
             ConnectParent = comp;
         }
     }
 }
Пример #2
0
        // Token: 0x0600006D RID: 109 RVA: 0x000037D4 File Offset: 0x000019D4
        public override void CompTick()
        {
            bool flag = this.PowerOn != this.curSignal;

            if (flag)
            {
                this.parent.BroadcastCompSignal(this.PowerOn ? CompSignals.PowerTurnedOn : CompSignals.PowerTurnedOff);
                this.curSignal = this.PowerOn;
            }
            bool flag2 = !this.PowerOn && Find.TickManager.TicksGame % this.tickInterval == this.HashCodeToMod(this.tickInterval);

            if (flag2)
            {
                CompPowerTraderFloor compPowerTraderFloor = ActiveTerrainUtility.TryFindNearestPowerConduitFloor(this.parent.Position, this.parent.Map);
                bool flag3 = compPowerTraderFloor != null;
                if (flag3)
                {
                    this.ConnectParent = compPowerTraderFloor;
                }
            }
        }