예제 #1
0
파일: Map.cs 프로젝트: sinshu/mafia
        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
파일: Map.cs 프로젝트: sinshu/mafia
 public bool IsObstacle(Dim d)
 {
     return this[d] != NONE;
 }