/// <summary> /// Stores Atmospheric Gas Static Data. /// </summary> internal void Store(WeightedList <AtmosphericGasSD> atmosphericGases) { if (atmosphericGases != null) { foreach (WeightedValue <AtmosphericGasSD> atmosphericGas in atmosphericGases) { if (AtmosphericGases.ContainsValue(atmosphericGas.Value)) { // Update existing value int index = AtmosphericGases.IndexOf(atmosphericGas.Value); AtmosphericGases[index] = atmosphericGas; } else { // Add new value AtmosphericGases.Add(atmosphericGas); } } } }
/// <summary> /// Adds the contents of another weighted list to this one. /// </summary> /// <param name="otherList">The list to add.</param> public void AddRange(WeightedList <T> otherList) { _valueList.AddRange(otherList._valueList); TotalWeight += otherList.TotalWeight; }
/// <summary> /// Deep copy consturctor /// </summary> public WeightedList(WeightedList <T> weightedList) { _valueList = new List <WeightedValue <T> >(weightedList._valueList); TotalWeight = weightedList.TotalWeight; }