Players can't play two games in one league series against each other.
This commit is contained in:
@@ -221,7 +221,7 @@ public class LeagueService {
|
|||||||
public boolean canPlayRankedGame(League league, LeagueSerie season, String playerOne, String playerTwo) {
|
public boolean canPlayRankedGame(League league, LeagueSerie season, String playerOne, String playerTwo) {
|
||||||
Collection<LeagueMatch> playedInSeason = _leagueMatchDao.getPlayerMatchesPlayedOn(league, season, playerOne);
|
Collection<LeagueMatch> playedInSeason = _leagueMatchDao.getPlayerMatchesPlayedOn(league, season, playerOne);
|
||||||
for (LeagueMatch leagueMatch : playedInSeason) {
|
for (LeagueMatch leagueMatch : playedInSeason) {
|
||||||
if (playerTwo.equals(leagueMatch.getWinner()) && playerTwo.equals(leagueMatch.getLoser()))
|
if (playerTwo.equals(leagueMatch.getWinner()) || playerTwo.equals(leagueMatch.getLoser()))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user