private boolean isTeamWinInFulltime(TeamLocation teamLocation) { if (teamLocation == TeamLocation.ANY) { throw new RuntimeException("lol"); } Results fulltimeResults = match.getFulltimeResults(); if (teamLocation == TeamLocation.HOME || teamLocation == TeamLocation.GUEST) { return teamLocation.equals(fulltimeResults); } if (teamLocation == TeamLocation.FAVORITE) { return isFavoriteHome() ? fulltimeResults == Results.HOME : fulltimeResults == Results.GUEST; } if (teamLocation == TeamLocation.NOTFAVORITE) { return isFavoriteHome() ? fulltimeResults == Results.GUEST : fulltimeResults == Results.HOME; } throw new RuntimeException("lol"); }
public boolean isScoredFirstGoal(TeamLocation teamLocation) { TeamLocation whoScoredFirstGoal = match.getScore().whoScoredFirstGoal(); if (whoScoredFirstGoal == null) { return false; } if (teamLocation == TeamLocation.ANY) { return true; } else if (teamLocation == TeamLocation.HOME || teamLocation == TeamLocation.GUEST) { return teamLocation.equals(whoScoredFirstGoal); } else if (teamLocation == TeamLocation.FAVORITE) { return isFavoriteHome() ? whoScoredFirstGoal == TeamLocation.HOME : whoScoredFirstGoal == TeamLocation.GUEST; } else if (teamLocation == TeamLocation.NOTFAVORITE) { return isFavoriteHome() ? whoScoredFirstGoal == TeamLocation.GUEST : whoScoredFirstGoal == TeamLocation.HOME; } else { throw new RuntimeException("lol"); } }