public void Add(ImportantTemperatureHold value) { if (nextIndex >= arr.Length) { throw new IndexOutOfRangeException($"The collection can hold only {arr.Length} elements."); } arr[nextIndex++] = value; }
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; } } }
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; } }