Esempio n. 1
0
        //---------------------------------------//

        /// <summary>
        /// Create a new map segment.
        /// </summary>
        public FlowRig(double target, int maxItems = 100, IEqualityComparer <TValue> equalityComparer = null)
        {
            TargetKey  = target;
            MaxItems   = maxItems;
            _rig       = new SortedRig <double, TValue>(SortedRig <double, TValue> .AverageDouble);
            Collection = equalityComparer == null ? new HashSet <TValue>() : new HashSet <TValue>(equalityComparer);
        }
Esempio n. 2
0
 /// <summary>
 /// Initialize a RangeRig with a preconstructed collection of Ranges.
 /// </summary>
 public RangeRig(SortedRig <TKey, Range> ranges)
 {
     Ranges = ranges;
 }
Esempio n. 3
0
            //-------------------------------------------//

            public Enumerator(SortedRig <TKey, TValue> rig)
            {
                _rig  = rig;
                Index = 0;
            }
Esempio n. 4
0
        //-------------------------------------------//

        //-------------------------------------------//

        /// <summary>
        /// Initialize a new range map. Optionally with an initial capacity.
        /// </summary>
        public RangeRig(Func <TKey, TKey, TKey> getAverage, int capacity = 2)
        {
            // construct the sorted rig
            Ranges = new SortedRig <TKey, Range>(getAverage, capacity);
        }