Fixing daily tournament prizes.
This commit is contained in:
@@ -4,13 +4,19 @@ public class PlayerStanding {
|
||||
private String _playerName;
|
||||
private int _points;
|
||||
private int _gamesPlayed;
|
||||
private int _playerWins;
|
||||
private int _playerLosses;
|
||||
private int _playerByes;
|
||||
private float _opponentWin;
|
||||
private int _standing;
|
||||
|
||||
public PlayerStanding(String playerName, int points, int gamesPlayed) {
|
||||
public PlayerStanding(String playerName, int points, int gamesPlayed, int playerWins, int playerLosses, int playerByes) {
|
||||
_playerName = playerName;
|
||||
_points = points;
|
||||
_gamesPlayed = gamesPlayed;
|
||||
_playerWins = playerWins;
|
||||
_playerLosses = playerLosses;
|
||||
_playerByes = playerByes;
|
||||
}
|
||||
|
||||
public int getGamesPlayed() {
|
||||
@@ -33,6 +39,18 @@ public class PlayerStanding {
|
||||
return _standing;
|
||||
}
|
||||
|
||||
public int getPlayerWins() {
|
||||
return _playerWins;
|
||||
}
|
||||
|
||||
public int getPlayerLosses() {
|
||||
return _playerLosses;
|
||||
}
|
||||
|
||||
public int getPlayerByes() {
|
||||
return _playerByes;
|
||||
}
|
||||
|
||||
public void setOpponentWin(float opponentWin) {
|
||||
_opponentWin = opponentWin;
|
||||
}
|
||||
|
||||
@@ -14,10 +14,11 @@ public class DailyTournamentPrizes implements TournamentPrizes {
|
||||
@Override
|
||||
public CardCollection getPrizeForTournament(PlayerStanding playerStanding, int playersCount) {
|
||||
DefaultCardCollection tournamentPrize = new DefaultCardCollection();
|
||||
tournamentPrize.addItem("(S)Booster Choice", playerStanding.getPoints());
|
||||
tournamentPrize.addItem("(S)Booster Choice", (playerStanding.getPlayerWins() + playerStanding.getPlayerByes()) * 2);
|
||||
|
||||
if (tournamentPrize.getAll().size() == 0)
|
||||
if (tournamentPrize.getAll().size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return tournamentPrize;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user