+ else {
+ let normalMoves = [];
+ switch (this.getPiece(x, y)) {
+ case V.PAWN:
+ normalMoves = this.getPotentialPawnMoves([x, y]);
+ break;
+ case V.ROOK:
+ normalMoves = this.getPotentialRookMoves([x, y]);
+ break;
+ case V.KNIGHT:
+ normalMoves = this.getPotentialKnightMoves([x, y]);
+ break;
+ case V.ELEPHANT:
+ normalMoves = this.getPotentialElephantMoves([x, y]);
+ break;
+ case V.ADVISOR:
+ normalMoves = this.getPotentialAdvisorMoves([x, y]);
+ break;
+ case V.KING:
+ normalMoves = this.getPotentialKingMoves([x, y]);
+ break;
+ case V.CANNON:
+ normalMoves = this.getPotentialCannonMoves([x, y]);
+ break;
+ }
+ Array.prototype.push.apply(moves, normalMoves);
+ }