public Player getWinner(GameState state) {
		checkState(isGameCompleted(state), "game was not completed");
		
		Player winner = null;
		
		// We maintain the top two scores so that we can check for ties between 
		// the top two players.
		int bestScore = -1;
		int secondBestScore = -1;
		
		for(Player p : state.getPlayers()) {
			int score = getScore(state, p);
			
			if(score > bestScore) {
				secondBestScore = bestScore;
				bestScore = score;
				winner = p;
			}
			else if(score > secondBestScore) {
				secondBestScore = score;
			}
		}
		
		// Check if the top two scores are tied.
		if(secondBestScore == bestScore)
			return null;
		
		return winner;
	}