Comparing version 1.6.5 to 1.6.6
@@ -503,2 +503,14 @@ "use strict"; | ||
}; | ||
var isOnRightmostRow = function (move) { | ||
return exports.getHorizontalCoordinate(move) === 'i'; | ||
}; | ||
var isOnLeftmostRow = function (move) { | ||
return exports.getHorizontalCoordinate(move) === 'a'; | ||
}; | ||
var isOnTopRow = function (move) { | ||
return exports.getVerticalCoordinate(move) === 9; | ||
}; | ||
var isOnBottomRow = function (move) { | ||
return exports.getVerticalCoordinate(move) === 1; | ||
}; | ||
var isValidNormalMove = function (game, currentPosition, move) { | ||
@@ -542,4 +554,9 @@ var x = exports.getHorizontalCoordinate(currentPosition); | ||
y: incrementVerticalPiecePosition(y), | ||
}))) | ||
})) && | ||
!isOnTopRow(exports.moveObjectToMove({ | ||
x: x, | ||
y: incrementVerticalPiecePosition(y), | ||
}))) { | ||
return false; | ||
} | ||
if (hasWallAbove(game, currentPosition)) | ||
@@ -561,2 +578,6 @@ return false; | ||
y: incrementVerticalPiecePosition(y), | ||
})) && | ||
!isOnTopRow(exports.moveObjectToMove({ | ||
x: x, | ||
y: incrementVerticalPiecePosition(y), | ||
}))) | ||
@@ -598,4 +619,9 @@ return false; | ||
y: y, | ||
}))) | ||
})) && | ||
!isOnRightmostRow(exports.moveObjectToMove({ | ||
x: incrementHorizontalPiecePosition(x), | ||
y: y, | ||
}))) { | ||
return false; | ||
} | ||
if (hasWallToTheRight(game, currentPosition)) | ||
@@ -607,4 +633,5 @@ return false; | ||
y: y, | ||
}))) | ||
}))) { | ||
return false; | ||
} | ||
return true; | ||
@@ -618,2 +645,6 @@ } | ||
y: y, | ||
})) && | ||
!isOnRightmostRow(exports.moveObjectToMove({ | ||
x: incrementHorizontalPiecePosition(x), | ||
y: y, | ||
}))) | ||
@@ -656,4 +687,9 @@ return false; | ||
y: decrementVerticalPiecePosition(y), | ||
}))) | ||
})) && | ||
!isOnBottomRow(exports.moveObjectToMove({ | ||
x: x, | ||
y: decrementVerticalPiecePosition(y), | ||
}))) { | ||
return false; | ||
} | ||
if (hasWallBelow(game, currentPosition)) | ||
@@ -665,4 +701,9 @@ return false; | ||
y: decrementVerticalPiecePosition(y), | ||
}))) | ||
})) && | ||
!isOnBottomRow(exports.moveObjectToMove({ | ||
x: x, | ||
y: decrementVerticalPiecePosition(y), | ||
}))) { | ||
return false; | ||
} | ||
return true; | ||
@@ -676,2 +717,6 @@ } | ||
y: decrementVerticalPiecePosition(y), | ||
})) && | ||
!isOnBottomRow(exports.moveObjectToMove({ | ||
x: x, | ||
y: decrementVerticalPiecePosition(y), | ||
}))) | ||
@@ -713,4 +758,9 @@ return false; | ||
y: y, | ||
}))) | ||
})) && | ||
!isOnLeftmostRow(exports.moveObjectToMove({ | ||
x: decrementHorizontalPiecePosition(x), | ||
y: y, | ||
}))) { | ||
return false; | ||
} | ||
if (hasWallToTheLeft(game, currentPosition)) | ||
@@ -732,4 +782,9 @@ return false; | ||
y: y, | ||
}))) | ||
})) && | ||
!isOnLeftmostRow(exports.moveObjectToMove({ | ||
x: decrementHorizontalPiecePosition(x), | ||
y: y, | ||
}))) { | ||
return false; | ||
} | ||
if (hasWallToTheLeft(game, currentPosition)) | ||
@@ -736,0 +791,0 @@ return false; |
{ | ||
"name": "quoridor", | ||
"version": "1.6.5", | ||
"version": "1.6.6", | ||
"description": "A JavaScipt Quoridor library for move validation etc.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
121588
2610