diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 854915f..937fb98 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,24 +5,10 @@ - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -102,6 +60,7 @@ "node.js.detected.package.tslint": "true", "node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", "vue.rearranger.settings.migration": "true" } }]]> diff --git a/src/main/java/laboratoire4/Pushed.java b/src/main/java/laboratoire4/Pushed.java index 927c490..8a69b3a 100644 --- a/src/main/java/laboratoire4/Pushed.java +++ b/src/main/java/laboratoire4/Pushed.java @@ -18,8 +18,8 @@ public class Pushed extends Pawn { pusher = board[row - direction][col]; } - boolean pusherValid = pusher instanceof Pusher; - boolean destinationValid = to == null || to.player != this.player; + boolean pusherValid = pusher instanceof Pusher && pusher.player == player; + boolean destinationValid = to == null || (movement != PawnMovement.STRAIGHT && to.player != this.player); return pusherValid && destinationValid; } diff --git a/src/main/java/laboratoire4/PusherBoard.java b/src/main/java/laboratoire4/PusherBoard.java index b2ebf07..33d3621 100644 --- a/src/main/java/laboratoire4/PusherBoard.java +++ b/src/main/java/laboratoire4/PusherBoard.java @@ -87,7 +87,7 @@ public class PusherBoard { Pawn destPawn = board[to_row][to_col]; if (destPawn != null) { - if (destPawn.getPlayer() == Player.RED) { + if (destPawn.getPlayer() == player) { maxPawns.remove(destPawn); } else { minPawns.remove(destPawn);