Exemplo n.º 1
0
            public override void Move(int ai_Count)
            {
                int li_Index = mi_Index + ai_Count;

                if (li_Index > mk_Deque.Count)
                {
                    throw new InvalidOperationException("Tried to move beyond end element.");
                }
                else if (li_Index < 0)
                {
                    throw new InvalidOperationException("Tried to move before first element.");
                }

                mi_Index        = li_Index;
                mi_BlockOffset += ai_Count;

                if (mi_BlockOffset >= k_Deque.mi_BlockSize || mi_BlockOffset < 0)
                {
                    mi_BlockIndex = mk_Deque.CalcBlockAndPos(mi_Index, out mi_BlockOffset);
                }
            }
Exemplo n.º 2
0
 public k_BlockIterator(k_Deque ak_Deque, int ai_Index)
 {
     mk_Deque      = ak_Deque;
     mi_Index      = ai_Index;
     mi_BlockIndex = mk_Deque.CalcBlockAndPos(mi_Index, out mi_BlockOffset);
 }
Exemplo n.º 3
0
 public k_BlockIterator(k_Deque ak_Deque, int ai_Index)
 {
     mk_Deque = ak_Deque;
     mi_Index = ai_Index;
     mi_BlockIndex = mk_Deque.CalcBlockAndPos(mi_Index, out mi_BlockOffset);
 }