Exemplo 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);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initialize a RangeRig with a preconstructed collection of Ranges.
 /// </summary>
 public RangeRig(SortedRig <TKey, Range> ranges)
 {
     Ranges = ranges;
 }
Exemplo n.º 3
0
            //-------------------------------------------//

            public Enumerator(SortedRig <TKey, TValue> rig)
            {
                _rig  = rig;
                Index = 0;
            }
Exemplo 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);
        }