예제 #1
0
 protected override bool Validate()
 {
     if (compAir.connectedNet == null)
     {
         return(false);
     }
     room = RoomVec.GetRoom(this.Map);
     return(Net ? compTempControl.targetTemperature + 1 > compAir.connectedNet.NetTemperature + 5 : compTempControl.targetTemperature + 1 > room.Temperature + 5);
 }
        protected virtual bool Validate()
        {
            if (compAir.connectedNet == null)
            {
                return(false);
            }

            room = RoomVec.GetRoom(this.Map);

            if (room == null)
            {
                return(false);
            }

            return(compPowerTrader != null && compPowerTrader.PowerOn);
        }
        /// <summary>
        /// Base validater. Checks if vecNorth is passable, room is there, is building locked, and power is on.
        /// </summary>
        protected virtual bool Validate()
        {
            if (compAir.connectedNet == null)
            {
                return(false);
            }

            if (RoomVec.Impassable())
            {
                return(false);
            }

            room = RoomVec.GetRoom();
            if (room == null)
            {
                return(false);
            }

            return(!isLocked && (compPowerTrader == null || compPowerTrader.PowerOn));
        }
        /// <summary>
        /// Base validater. Checks if vecNorth is passable, room is there, is building locked, and power is on.
        /// </summary>
        protected virtual bool Validate()
        {
            if (compAir.connectedNet == null)
            {
                return(false);
            }

            if (RoomVec.Impassable(this.Map))
            {
                return(false);
            }

            room = RoomVec.GetRoom(this.Map);

            if (room == null)
            {
                return(false);
            }

            if (isLocked)
            {
                if (shouldChange)
                {
                    shouldChange = !shouldChange;
                    int units = compAir.Props.units;
                    if (units > 0)
                    {
                        compAir.connectedNet.pushers -= units;
                    }
                    else
                    {
                        compAir.connectedNet.pullers -= -units;
                    }
                }
                return(false);
            }

            return(compPowerTrader == null || compPowerTrader.PowerOn);
        }