Commit c066c7af authored by Erwan BOISTEAU-DESDEVISES's avatar Erwan BOISTEAU-DESDEVISES
Browse files

ajout d'un peu de documentation

parent b0f3ec7a
......@@ -236,6 +236,13 @@ export function camelMove(board: Chessboard, move: Move): boolean {
return false;
}
/**
* checks if a piece is positioned between the beginning and the end of a diagonal move
*
* @param board The chessboard of the current game
* @param move
*/
export function diagonaleMoveCheck(board : Chessboard, move : Move) : boolean{
if(Math.abs(move.from!.rank - move.to!.rank) != Math.abs(move.from!.file - move.to!.file)){
......@@ -281,6 +288,13 @@ export function diagonaleMoveCheck(board : Chessboard, move : Move) : boolean{
}
}
/**
* checks if a piece is positioned between the beginning and the end of a straight move
*
* @param board The chessboard of the current game
* @param move
*/
export function straightMoveCheck(board : Chessboard, move : Move) : boolean {
if(move.from!.rank == move.to!.rank){
if(move.from!.file < move.to!.file){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment