示例#1
0
 public void Consume(double liters)
 {
     if (IsRunning)
     {
         fuelTank.Consume(liters);
     }
 }
示例#2
0
 public void RunningIdle()
 {
     engine.Consume(.0003);
     fuelTank.Consume(.0003);
     fuelTankDisplay.IsOnReserve = fuelTank.IsOnReserve;
     fuelTankDisplay.IsComplete  = fuelTank.IsComplete;
     fuelTankDisplay.FillLevel   = fuelTank.FillLevel;
 }
示例#3
0
 public void Consume(double liters)
 {
     if (_isRunning)
     {
         _fuelTank.Consume(liters);
         if (_fuelTank.FillLevel == 0)
         {
             Stop();
         }
     }
 }
示例#4
0
 public void Consume(double liters)
 {
     if (IsRunning && (fuelTank.FillLevel >= liters))
     {
         fuelTank.Consume(liters);
     }
     if (fuelTank.FillLevel == 0)
     {
         Stop();
     }
 }
示例#5
0
 public void Consume(double liters)
 {
     if (fuelTank.FillLevel < Car.FuelPerSec)
     {
         Stop();
     }
     else if (IsRunning)
     {
         fuelTank.Consume(liters);
     }
 }
示例#6
0
 public void RunningIdle()
 {
     if (engine.IsRunning)
     {
         fuelTank.Consume(FuelConsumption);
     }
     if (fuelTank.FillLevel == 0)
     {
         engine.Stop();
     }
 }
示例#7
0
 public void Consume(double liters)
 {
     if (running)
     {
         _fuelTank.Consume(liters);
     }
     if (_fuelTank.FillLevel == 0)
     {
         this.Stop();
     }
 }
示例#8
0
 public void RunningIdle()
 {
     if (engine.IsRunning)
     {
         fuelTank.Consume(0.0003);
     }
     if (fuelTank.FillLevel <= 0)
     {
         engine.Stop();
     }
     onBoardComputer.ElapseSecond();
 }
 public void Consume(double liters)
 {
     if (fuelTank.FillLevel < Car.FuelPerSec)
     {
         Stop();
     }
     else if (IsRunning)
     {
         fuelTank.Consume(liters);
         EngineConsumedFuel?.Invoke(this, new EvArgs <double>(liters));
     }
 }
示例#10
0
 public void Consume(double liters)
 {
     if (IsRunning)
     {
         _fuelTank.Consume(liters);
         Consumption += liters;
         ConsumptionList.Add(liters);
         if (_fuelTank.FillLevel == 0)
         {
             Stop();
         }
     }
 }
示例#11
0
        public void Consume(double liters)
        {
            if (!IsRunning)
            {
                return;
            }

            if (_fuelTank.FillLevel == 0)
            {
                Stop();
                return;
            }

            _fuelTank.Consume(liters);
        }
示例#12
0
        public void Consume(double liters)
        {
            if (!IsRunning)
            {
                return;
            }

            if (fuelTank.FillLevel > liters)
            {
                fuelTank.Consume(liters);
            }
            else
            {
                IsRunning = false;
            }
        }
示例#13
0
 public void Consume(double liters)
 {
     fuelTank.Consume(liters);
 }
示例#14
0
文件: Car.cs 项目: mcstephe/wargames
 public void Consume(double liters)
 {
     tank.Consume(liters);
 }