Exemple #1
0
 public List <Coord> AskMoveIntoAList(Coord coord)
 {
     if (GameBoard[coord.x, coord.y].id == "\u2659")
     {
         Console.Write("\u2659");
         Pawn         piece            = new Pawn(Piece.Color.black);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u265F")
     {
         Console.Write("\u265F");
         Pawn         piece            = new Pawn(Piece.Color.white);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u2658")
     {
         Console.Write("\u2658");
         Knight       piece            = new Knight(Piece.Color.black);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u265E")
     {
         Console.Write("\u265E");
         Knight       piece            = new Knight(Piece.Color.white);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u2654")
     {
         Console.Write("\u2654");
         King         piece            = new King(Piece.Color.black);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u265A")
     {
         Console.Write("\u265A");
         King         piece            = new King(Piece.Color.white);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u2656")
     {
         Console.Write("\u2656");
         Rook         piece            = new Rook(Piece.Color.black);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u265C")
     {
         Console.Write("\u265C");
         Rook         piece            = new Rook(Piece.Color.white);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u2655")
     {
         Console.Write("\u2655");
         Queen        piece            = new Queen(Piece.Color.black);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u265B")
     {
         Console.Write("\u265B");
         Queen        piece            = new Queen(Piece.Color.white);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u2657")
     {
         Console.Write("\u2657");
         Bishop       piece            = new Bishop(Piece.Color.black);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else if (GameBoard[coord.x, coord.y].id == "\u265D")
     {
         Console.Write("\u265D");
         Bishop       piece            = new Bishop(Piece.Color.white);
         List <Coord> coordDestination = piece.GetPossibleMoves(GameBoard, coord);
         return(coordDestination);
     }
     else
     {
         return(null);
     }
 }