Exemplo n.º 1
0
        public Knight(int x, int y, PieceColorEnum color)
        {
            this.CurrentLocation_x = x;
            this.CurrentLocation_y = y;

            Type          = PieceTypeEnum.Knight;
            BoardNotation = 'N';
            Value         = 3;
            Color         = color;
        }
Exemplo n.º 2
0
        public Bishop(int x, int y, PieceColorEnum color)
        {
            this.Type          = PieceTypeEnum.Bishop;
            this.BoardNotation = 'B';
            this.Value         = 3;
            this.Color         = color;

            this.CurrentLocation_x = x;
            this.CurrentLocation_y = y;
        }
Exemplo n.º 3
0
        public Rook(int x, int y, PieceColorEnum color)
        {
            this.CurrentLocation_x = x;
            this.CurrentLocation_y = y;

            Type          = PieceTypeEnum.Rook;
            BoardNotation = 'R';
            Value         = 5;
            Color         = color;
        }
Exemplo n.º 4
0
        public Queen(int x, int y, PieceColorEnum color)
        {
            this.CurrentLocation_x = x;
            this.CurrentLocation_y = y;

            Type          = PieceTypeEnum.Queen;
            BoardNotation = 'Q';
            Value         = 8;
            Color         = color;
        }
Exemplo n.º 5
0
        public Pawn(int x, int y, PieceColorEnum color)
        {
            this.CurrentLocation_x = x;
            this.CurrentLocation_y = y;

            Type          = PieceTypeEnum.Pawn;
            BoardNotation = 'P';
            Value         = 1;
            Color         = color;
        }
Exemplo n.º 6
0
        public King(int x, int y, PieceColorEnum color)
        {
            this.CurrentLocation_x = x;
            this.CurrentLocation_y = y;

            this.Type          = PieceTypeEnum.King;
            this.BoardNotation = 'K';
            this.Value         = 1000;
            this.Color         = color;
        }
Exemplo n.º 7
0
        public bool IsStaleMate(PieceColorEnum colorToMove)
        {
            // side to move has nowhere to move
            foreach (var piece in this.Instance)
            {
                if (piece != null && piece.Color == colorToMove)
                {
                    var test = piece.AvailableMoves(this);
                    if (test.Any())
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }