Fixing daily tournament prizes.

This commit is contained in:
marcins78@gmail.com
2014-05-01 18:02:14 +00:00
parent 8969038387
commit b4037e6340
2 changed files with 22 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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;
}