Comparing version 2.3.5 to 2.3.6
@@ -578,11 +578,2 @@ "use strict"; | ||
exports.doesHorizontalWallBlockPlayer = doesHorizontalWallBlockPlayer; | ||
var numberToLetter = function (num) { | ||
return String.fromCharCode(96 + num); | ||
}; | ||
var decrementLetter = function (letter) { | ||
return numberToLetter(letterToNumber(letter) - 1); | ||
}; | ||
var incrementLetter = function (letter) { | ||
return numberToLetter(letterToNumber(letter) + 1); | ||
}; | ||
var verticallyIncrementPawnPosition = function (position) { | ||
@@ -676,2 +667,22 @@ return consts_1.verticallyIncrementedPawnPositions[position]; | ||
var currentPosition = game.playerPositions[(0, getTurn_1.getTurn)(game)].position; | ||
var unvalidatedPawnMoveArray = [ | ||
getPositionFromNorthMove(currentPosition), | ||
getPositionFromEastMove(currentPosition), | ||
getPositionFromWestMove(currentPosition), | ||
getPositionFromSouthMove(currentPosition), | ||
]; | ||
// This can be extended to also check if the players are next to each other | ||
var includeMovesOverOpponent = game.pastMoves.length >= 7; | ||
if (includeMovesOverOpponent) { | ||
unvalidatedPawnMoveArray.concat([ | ||
getPositionFromNorthNorthMove(currentPosition), | ||
getPositionFromNorthEastMove(currentPosition), | ||
getPositionFromNorthWestMove(currentPosition), | ||
getPositionFromEastEastMove(currentPosition), | ||
getPositionFromWestWestMove(currentPosition), | ||
getPositionFromSouthEastMove(currentPosition), | ||
getPositionFromSouthWestMove(currentPosition), | ||
getPositionFromSouthSouthMove(currentPosition), | ||
]); | ||
} | ||
var validPawnMoveArray = [ | ||
@@ -678,0 +689,0 @@ getPositionFromNorthMove(currentPosition), |
{ | ||
"name": "quoridor", | ||
"version": "2.3.5", | ||
"version": "2.3.6", | ||
"description": "A JavaScipt Quoridor library for move validation etc.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
215307
6151