Exemplo n.º 1
0
        public ArrayElement GetItemLocation(int index)
        {
            ArrayElement point;

            if (index < 0 || index >= m_Items.Length)
            {
                throw new IndexOutOfRangeException("Index is out of range");
            }

            point     = new ArrayElement();
            point.Row = index / this.ArraySize.Cols;
            point.Col = index - (point.Row * this.ArraySize.Rows);

            return(point);
        }
Exemplo n.º 2
0
 public int GetItemIndex(ArrayElement point)
 {
     return(this.GetItemIndex(point.Row, point.Col));
 }
Exemplo n.º 3
0
 public T this[ArrayElement location]
 {
     get { return(this[location.Row, location.Col]); }
     set { this[location.Row, location.Col] = value; }
 }