Esempio n. 1
0
        /// <summary>
        /// Проверяет имеется ли передаваемый тип элемента в соответствующих координатах.
        /// </summary>
        public bool HasElementAt(BoardPoint point, BoardElement element)
        {
            if (point.IsOutOfBoard(Size))
            {
                return(false);
            }

            return(GetElementAt(point) == element);
        }
Esempio n. 2
0
        public BoardElement GetElementAtOrWall(BoardPoint point)
        {
            if (point.IsOutOfBoard(Size))
            {
                return(BoardElement.Wall);
            }

            return((BoardElement)BoardString[GetShiftByPoint(point)]);
        }
Esempio n. 3
0
 public bool IsBarrierAt(BoardPoint point)
 {
     return(GetBarriers().Contains(point));
 }
Esempio n. 4
0
 private int GetShiftByPoint(BoardPoint point)
 {
     return(point.Y * Size + point.X);
 }
Esempio n. 5
0
 public bool HasElementAt(BoardPoint point, params BoardElement[] elements)
 {
     return(elements.Any(e => HasElementAt(point, e)));
 }
Esempio n. 6
0
 public BoardElement GetElementAt(BoardPoint point)
 {
     return((BoardElement)BoardString[GetShiftByPoint(point)]);
 }
Esempio n. 7
0
 public bool IsBadThingAt(BoardPoint point)
 {
     return(GetBadThings().Contains(point));
 }