Exemplo n.º 1
0
 public void finalizeGame() throws GameNotDoneException {
   switch (result) {
     case PLAYERAWIN:
       playerA.addWin();
       playerB.addLoss();
     case PLAYERBWIN:
       playerA.addLoss();
       playerB.addWin();
     case DRAW:
       playerA.addDraw();
       playerB.addDraw();
     case TBD:
       throw new GameNotDoneException();
     default:
       throw new AssertionError(result.name());
   }
 }