Example #1
0
 public void Add(ImportantTemperatureHold value)
 {
     if (nextIndex >= arr.Length)
     {
         throw new IndexOutOfRangeException($"The collection can hold only {arr.Length} elements.");
     }
     arr[nextIndex++] = value;
 }
Example #2
0
 public virtual void SetFinish(ImportantTemperatureHold importantTemperatureHold, MyBrewery myBrewery)
 {
     if (importantTemperatureHold.Reached == true && importantTemperatureHold.Elapsed == false)
     {
         importantTemperatureHold.Elapsed = myBrewery.ProgressTime >= importantTemperatureHold.StartTime + importantTemperatureHold.HoldingTime ? true : false;
         if (importantTemperatureHold.Elapsed == true)
         {
             importantTemperatureHold.Finished = true;
         }
     }
 }
Example #3
0
 public virtual void SetStartTime(ImportantTemperatureHold importantTemperatureHold, MyBrewery myBrewery)
 {
     if (importantTemperatureHold.Reached == false)
     {
         if (importantTemperatureHold.Name == "Boiling")
         {
             importantTemperatureHold.Reached = myBrewery.ActualTemperatureOfMashing >= importantTemperatureHold.Temperature - Shared.Constants.ToleranceOfSensor ? true : false;
         }
         else
         {
             importantTemperatureHold.Reached = myBrewery.ActualTemperatureOfMashing >= importantTemperatureHold.Temperature ? true : false;
         }
         if (importantTemperatureHold.Reached)
         {
             importantTemperatureHold.StartTime = myBrewery.ProgressTime;
         }
         return;
     }
 }