Пример #1
0
        public static void BoardForeach(this Board board, Action <Point> action)
        {
            LengthXY = new LengthToXY(board.BoardSize);
            var BoardSize = board.BoardSize;

            for (int i = 0; i < BoardSize * BoardSize; i++)
            {
                Point pt = LengthXY.GetXY(i);
                action(pt);
            }
        }
Пример #2
0
        public List <Point> Get(Element element)
        {
            List <Point> result = new List <Point>();

            for (int i = 0; i < Size * Size; i++)
            {
                Point point = lengthXY.GetXY(i);

                if (IsAt(point, element))
                {
                    result.Add(point);
                }
            }

            return(result);
        }