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

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

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