@Override
  public void update(Observable o, Object arg) {
    if(state == GameState.DURING && arg instanceof Piece) {
      // A piece was placed.
      
      switchPlayer();
      
      if(board.getValidMoves(currentPlayer.getColor()).size() == 0) {
        // The other player can't play, switch back.
        switchPlayer();
      }
      
      if(board.getValidMoves(currentPlayer.getColor()).size() == 0) {
        // Game over man!
        state = GameState.AFTER;
      }
      
      updateScores();
    }
  }