예제 #1
0
        public override List <Point> Available()
        {
            int x = position.X;
            int y = position.Y;

            AvailableSquares.Add(new Point(x, y));

            DiagonalValidation(x, y, 1, 1);
            DiagonalValidation(x, y, -1, 1);
            DiagonalValidation(x, y, -1, -1);
            DiagonalValidation(x, y, 1, -1);


            return(AvailableSquares);
        }
예제 #2
0
        public override List <Point> Available()
        {
            int x = position.X;
            int y = position.Y;

            AvailableSquares.Add(new Point(x, y));


            PreValid(x, 1, false);
            PreValid(x, 8, false);
            PreValid(1, y, true);
            PreValid(8, y, true);

            return(base.AvailableSquares);
        }
예제 #3
0
        public override List <Point> Available()
        {
            int x = position.X;
            int y = position.Y;

            if (!PointIsThreatened(position))
            {
                AvailableSquares.Add(position);
            }
            x--;
            y--;
            for (int i = 0; i < 2; i++)
            {
                if (!PointIsThreatened(new Point(++x, y)) && RegularValidation(x, y))
                {
                    AvailableSquares.Add(new Point(x, y));
                }
            }
            for (int i = 0; i < 2; i++)
            {
                if (!PointIsThreatened(new Point(x, ++y)) && RegularValidation(x, y))
                {
                    AvailableSquares.Add(new Point(x, y));
                }
            }
            for (int i = 0; i < 2; i++)
            {
                if (!PointIsThreatened(new Point(--x, y)) && RegularValidation(x, y))
                {
                    AvailableSquares.Add(new Point(x, y));
                }
            }
            for (int i = 0; i < 2; i++)
            {
                if (!PointIsThreatened(new Point(x, --y)) && RegularValidation(x, y))
                {
                    AvailableSquares.Add(new Point(x, y));
                }
            }


            return(AvailableSquares);
        }