Ejemplo n.º 1
0
        public void PiececanMove(string Piece, int x, int y, Board[,] MyBoard, Button[,] MyButton)
        {
            switch (Piece)
            {
            case "Pawn":
                Pawn.canMove(x, y, MyBoard, MyButton);
                break;

            case "Rook":
                Rook.canMove(x, y, MyBoard, MyButton);
                break;

            case "Bishop":
                Bishop.canMove(x, y, MyBoard, MyButton);
                break;

            case "Queen":
                Queen.canMove(x, y, MyBoard, MyButton);
                break;

            case "King":
                King.canMove(x, y, MyBoard, MyButton);
                break;

            case "Knight":
                Knight.canMove(x, y, MyBoard, MyButton);
                break;
            }
        }
Ejemplo n.º 2
0
        public virtual void canMove(int Xcoord, int Ycoord, Board[,] MyBoard, Button[,] MyButton)
        {
            Rook   MyRook   = new Rook(color);
            Bishop MyBishop = new Bishop(color);

            MyBishop.Move(Xcoord, Ycoord, MyBoard, MyButton);
            MyRook.Move(Xcoord, Ycoord, MyBoard, MyButton);
        }
Ejemplo n.º 3
0
        public override void Move(int Xcoord, int Ycoord, Board[,] MyBoard, Button[,] MyButton)
        {
            Rook   MyRook   = new Rook(color);
            Bishop MyBishop = new Bishop(color);

            MyBishop.Move(Xcoord, Ycoord, MyBoard, MyButton);
            MyRook.Move(Xcoord, Ycoord, MyBoard, MyButton);
        }
Ejemplo n.º 4
0
 public Player(string color, Board[,] MyBoard, Button[,] MyButton)
 {
     this.color = color;
     King       = new King(color, Pieces, MyBoard, MyButton); //first item from ArrList
     Knight     = new Knight(color, Pieces, MyBoard, MyButton);
     Rook       = new Rook(color, Pieces, MyBoard, MyButton);
     Bishop     = new Bishop(color, Pieces, MyBoard, MyButton);
     Pawn       = new Pawn(color, Pieces, MyBoard, MyButton);
     Queen      = new Queen(color, Pieces, MyBoard, MyButton);
 }