Skip to content

Commit

Permalink
ensure to set opponent's action to WAIT
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed May 21, 2011
1 parent 8234728 commit 227d486
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pylos/controller/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public static void updateView() {
}

public static void initTurn() {
for (Player player : Model.players)
player.resetAction();
Model.currentPlayer.resetAction();
Model.otherPlayer().waitForOther();

ballRemoved = 0;
updateView();
Expand Down
4 changes: 4 additions & 0 deletions src/pylos/model/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ public void isAI() {
System.out.println(toStringWithLocation());
}

public void waitForOther() {
action = Action.WAIT;
}

public boolean canMove() {
return Config.CAN_MOVE_OTHER || type == Type.LOCAL;
}
Expand Down

0 comments on commit 227d486

Please sign in to comment.