Пример #1
0
        public int this[Dim d]
        {
            get
            {
                int row = d.Row;
                int col = d.Col;
                if (row < 0 || numRows <= row || col < 0 || numCols <= col)
                {
                    return NONE;
                }
                return map[row, col];
            }

            set
            {
                int row = d.Row;
                int col = d.Col;
                if (row < 0 || numRows <= row || col < 0 || numCols <= col)
                {
                    return;
                }
                map[row, col] = value;
            }
        }
Пример #2
0
 public bool IsObstacle(Dim d)
 {
     return this[d] != NONE;
 }