예제 #1
0
  private void drawState() {
    if (modelFacade.isFinished() == false) {
      String currentPlayerName = modelFacade.getCurrentPlayerName();
      gameView.setCurrentPlayer(
          currentPlayerName + " " + em.get(modelFacade.getPlayerColor(currentPlayerName)));

      gameView.clearBoard();

      gameView.drawDice(modelFacade.getDice());

      for (String player : modelFacade.getAllPlayers()) {
        drawPlayerPawns(player);
      }

      if (modelFacade.noMove()) {
        gameView.showPassButton();
      } else {
        gameView.hidePassButton();
      }
    }
    if (modelFacade.winner()) {
      String player = modelFacade.getWinnerName();
      gameView.drawWinnerPrompt(player);
      gameView.showStartButton();
    }
  }
예제 #2
0
 public void doMove(PawnView p) {
   if (modelFacade.isFinished() == false) {
     if (em.get(modelFacade.getPlayerColor(modelFacade.getCurrentPlayerName())) == p.getColor()) {
       modelFacade.doMove(p.getPawnNumber());
       drawState();
     }
   }
   checkIfYourTurn();
   sendState();
 }