Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
gggdttt committed May 1, 2022
1 parent e6303e7 commit 3f9f6f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/main/java/controller/game/GameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ private Timer invokeActivationPhaseTimer(GamePanel gamePanel) {
gamePanel.getMatPanel().getLblDiscardCards().setText("Discard Pile: " + game.getUser().getDiscardPile().getDiscards().size());
}

gamePanel.getInfoPanel().updateParticipantsInfo(registerIndex,currentPlayer);
for (Player player: game.getParticipants()){
gamePanel.getBoardPanel().getBoard()[player.getRobot().getPosition().getRow()][player.getRobot().getPosition().getCol()].setRobot(player.getRobot().getOrientation(), player);
}
Expand All @@ -438,9 +439,9 @@ private Timer invokeActivationPhaseTimer(GamePanel gamePanel) {
}

}
gamePanel.getInfoPanel().updateParticipantsInfo(registerIndex--,currentPlayer);

if (registerIndex == RegisterArea.REGISTER_QUEUE_SIZE) {
gamePanel.getInfoPanel().removeCradInfo(currentPlayer);
gamePanel.getInfoPanel().removeCardInfo();
// one round finish
game.setCurrentRoundNum(++round);
game.setCurrentRegisterNum(0);
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/gui/game/InfoPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,14 @@ public void updateParticipantsInfo(int register, Player player) {
}
}

public void removeCradInfo(Player player) {
public void removeCardInfo() {
for (ParticipantInfoPanel participantInfoPanel : participantsPanels) {
if (player.getName().equals(participantInfoPanel.getLabelUserName().getText())) {
participantInfoPanel.getRegisters()[0].setText("NaN");
participantInfoPanel.getRegisters()[1].setText("NaN");
participantInfoPanel.getRegisters()[2].setText("NaN");
participantInfoPanel.getRegisters()[3].setText("NaN");
participantInfoPanel.getRegisters()[4].setText("NaN");
}
participantInfoPanel.getRegisters()[0].setText("NaN");
participantInfoPanel.getRegisters()[1].setText("NaN");
participantInfoPanel.getRegisters()[2].setText("NaN");
participantInfoPanel.getRegisters()[3].setText("NaN");
participantInfoPanel.getRegisters()[4].setText("NaN");

}
}
}

0 comments on commit 3f9f6f9

Please sign in to comment.