예제 #1
0
            public void Reset()
            {
                this.mapVersion        = map.version;
                this.enumeratorVersion = unchecked (this.enumeratorVersion + 1);

                if (forward)
                {
                    index = -1;
                    if (startIndexed)
                    {
                        int xStart = 0, yStart = 0;
                        while ((index + 1 < map.items.Count) && (startIndex > (side == Side.X ? xStart : yStart)))
                        {
                            index++;
                            xStart += map.items[index].Item1;
                            yStart += map.items[index].Item2;
                        }
                    }
                }
                else
                {
                    index = map.items.Count;
                    if (startIndexed)
                    {
                        int xStart = map.GetExtent(Side.X);
                        int yStart = map.GetExtent(Side.Y);
                        while ((index - 1 >= 0) && (startIndex < (side == Side.X ? xStart - map.items[index - 1].Item1 : yStart - map.items[index - 1].Item2)))
                        {
                            index--;
                            xStart -= map.items[index].Item1;
                            yStart -= map.items[index].Item2;
                        }
                    }
                }
            }
예제 #2
0
            public override void Add()
            {
                int   i       = reference.Count > 0 ? random.Next((int)reference.Count + 1) : 0;
                int   xStart  = i < reference.Count ? ((INonInvasiveRange2MapInspection)reference).GetRanges()[i].x.start : reference.GetExtent(Side.X);
                int   xLength = random.Next(100) + 1;
                int   yLength = random.Next(100) + 1;
                float value   = (float)random.NextDouble();

                actual.Insert(xStart, Side.X, xLength, yLength, value); // throws when capacity locked & exhausted

                reference.Insert(xStart, Side.X, xLength, yLength, value);
            }
예제 #3
0
 public int GetExtent(Side side)
 {
     return(inner.GetExtent(side));
 }
예제 #4
0
 public int GetExtent()
 {
     return(inner.GetExtent(Side.X));
 }