Support for trophies as prizes for leagues and tournaments.

This commit is contained in:
marcins78
2013-12-18 14:47:30 +00:00
parent b6134e0f7d
commit 90d37145be
11 changed files with 38 additions and 0 deletions

View File

@@ -66,6 +66,9 @@ public class ConstructedLeagueData implements LeagueData {
CardCollection leaguePrize = _leaguePrizes.getPrizeForLeague(leagueStanding.getStanding(), leagueStandings.size(), leagueStanding.getGamesPlayed(), maxGamesCount, _collectionType);
if (leaguePrize != null)
collectionsManager.addItemsToPlayerCollection(true, "End of league prizes", leagueStanding.getPlayerName(), _prizeCollectionType, leaguePrize.getAll().values());
final CardCollection leagueTrophies = _leaguePrizes.getTrophiesForLeague(leagueStanding.getStanding(), leagueStandings.size(), leagueStanding.getGamesPlayed(), maxGamesCount, _collectionType);
if (leagueTrophies != null)
collectionsManager.addItemsToPlayerCollection(true, "End of league prizes", leagueStanding.getPlayerName(), CollectionType.TROPHY, leagueTrophies.getAll().values());
}
status++;
}

View File

@@ -56,6 +56,11 @@ public class FixedLeaguePrizes implements LeaguePrizes {
}
}
@Override
public CardCollection getTrophiesForLeague(int position, int playersCount, int gamesPlayed, int maxGamesPlayed, CollectionType collectionType) {
return null;
}
//1st - 60 boosters, 4 tengwar, 3 foil rares
//2nd - 55 boosters, 3 tengwar, 2 foil rares
//3rd - 50 boosters, 2 tengwar, 1 foil rare

View File

@@ -9,4 +9,6 @@ public interface LeaguePrizes {
public CardCollection getPrizeForLeagueMatchLoser(int winCountThisSerie, int totalGamesPlayedThisSerie);
public CardCollection getPrizeForLeague(int position, int playersCount, int gamesPlayed, int maxGamesPlayed, CollectionType collectionType);
public CardCollection getTrophiesForLeague(int position, int playersCount, int gamesPlayed, int maxGamesPlayed, CollectionType collectionType);
}

View File

@@ -70,6 +70,9 @@ public class NewConstructedLeagueData implements LeagueData {
CardCollection leaguePrize = _leaguePrizes.getPrizeForLeague(leagueStanding.getStanding(), leagueStandings.size(), leagueStanding.getGamesPlayed(), maxGamesPlayed, _collectionType);
if (leaguePrize != null)
collectionsManager.addItemsToPlayerCollection(true, "End of league prizes", leagueStanding.getPlayerName(), _prizeCollectionType, leaguePrize.getAll().values());
final CardCollection leagueTrophies = _leaguePrizes.getTrophiesForLeague(leagueStanding.getStanding(), leagueStandings.size(), leagueStanding.getGamesPlayed(), maxGamesPlayed, _collectionType);
if (leagueTrophies != null)
collectionsManager.addItemsToPlayerCollection(true, "End of league prizes", leagueStanding.getPlayerName(), CollectionType.TROPHY, leagueTrophies.getAll().values());
}
status++;
}

View File

@@ -93,6 +93,9 @@ public class NewSealedLeagueData implements LeagueData {
CardCollection leaguePrize = _leaguePrizes.getPrizeForLeague(leagueStanding.getStanding(), leagueStandings.size(), leagueStanding.getGamesPlayed(), maxGamesTotal, _collectionType);
if (leaguePrize != null)
collectionsManager.addItemsToPlayerCollection(true, "End of league prizes", leagueStanding.getPlayerName(), _prizeCollectionType, leaguePrize.getAll().values());
final CardCollection leagueTrophies = _leaguePrizes.getTrophiesForLeague(leagueStanding.getStanding(), leagueStandings.size(), leagueStanding.getGamesPlayed(), maxGamesTotal, _collectionType);
if (leagueTrophies != null)
collectionsManager.addItemsToPlayerCollection(true, "End of league prizes", leagueStanding.getPlayerName(), CollectionType.TROPHY, leagueTrophies.getAll().values());
}
status++;
}

View File

@@ -94,6 +94,9 @@ public class SealedLeagueData implements LeagueData {
CardCollection leaguePrize = _leaguePrizes.getPrizeForLeague(leagueStanding.getStanding(), leagueStandings.size(), leagueStanding.getGamesPlayed(), maxGamesPlayed, _collectionType);
if (leaguePrize != null)
collectionsManager.addItemsToPlayerCollection(true, "End of league prizes", leagueStanding.getPlayerName(), _prizeCollectionType, leaguePrize.getAll().values());
final CardCollection leagueTrophies = _leaguePrizes.getTrophiesForLeague(leagueStanding.getStanding(), leagueStandings.size(), leagueStanding.getGamesPlayed(), maxGamesPlayed, _collectionType);
if (leagueTrophies != null)
collectionsManager.addItemsToPlayerCollection(true, "End of league prizes", leagueStanding.getPlayerName(), CollectionType.TROPHY, leagueTrophies.getAll().values());
}
status++;
}

View File

@@ -27,6 +27,11 @@ public class DailyTournamentPrizes implements TournamentPrizes {
return tournamentPrize;
}
@Override
public CardCollection getTrophyForTournament(PlayerStanding playerStanding, int playersCount) {
return null;
}
@Override
public String getRegistryRepresentation() {
return _registryRepresentation;

View File

@@ -305,6 +305,9 @@ public class DefaultTournament implements Tournament {
CardCollection prizes = _tournamentPrizes.getPrizeForTournament(playerStanding, list.size());
if (prizes != null)
collectionsManager.addItemsToPlayerCollection(true, "Tournament " +getTournamentName()+" prize", playerStanding.getPlayerName(), CollectionType.MY_CARDS, prizes.getAll().values());
CardCollection trophies = _tournamentPrizes.getTrophyForTournament(playerStanding, list.size());
if (trophies != null)
collectionsManager.addItemsToPlayerCollection(true, "Tournament " +getTournamentName()+" trophy", playerStanding.getPlayerName(), CollectionType.TROPHY, trophies.getAll().values());
}
}

View File

@@ -9,6 +9,11 @@ public class NoPrizes implements TournamentPrizes{
return null;
}
@Override
public CardCollection getTrophyForTournament(PlayerStanding playerStanding, int playersCount) {
return null;
}
@Override
public String getRegistryRepresentation() {
return null;

View File

@@ -40,6 +40,11 @@ public class SingleEliminationOnDemandPrizes implements TournamentPrizes{
return tournamentPrize;
}
@Override
public CardCollection getTrophyForTournament(PlayerStanding playerStanding, int playersCount) {
return null;
}
private String getRandom(List<String> list) {
return list.get(new Random().nextInt(list.size()));
}

View File

@@ -5,6 +5,7 @@ import com.gempukku.lotro.game.CardCollection;
public interface TournamentPrizes {
public CardCollection getPrizeForTournament(PlayerStanding playerStanding, int playersCount);
public CardCollection getTrophyForTournament(PlayerStanding playerStanding, int playersCount);
public String getRegistryRepresentation();
public String getPrizeDescription();
}