/// <summary> /// Adds a value to the weighted list. /// </summary> /// <param name="weight">Weight of this value in the list.</param> public void Add(double weight, T value) { var listEntry = new WeightedValue <T> { Weight = weight, Value = value }; _valueList.Add(listEntry); TotalWeight += weight; }
public void Add(WeightedValue <T> value) { Add(value.Weight, value.Value); }
protected bool Equals(WeightedValue <T> other) { return(EqualityComparer <T> .Default.Equals(Value, other.Value)); }