Making sure that extra information is persisted in card collections
This commit is contained in:
@@ -146,11 +146,8 @@ public class DraftChoiceBuilder {
|
||||
JSONArray switchResult = (JSONArray) data.get("switchResult");
|
||||
|
||||
final List<DraftChoiceDefinition> draftChoiceDefinitionList = new ArrayList<DraftChoiceDefinition>();
|
||||
Iterator<JSONObject> switchResultIterator = switchResult.iterator();
|
||||
while (switchResultIterator.hasNext()) {
|
||||
JSONObject switchResultObject = switchResultIterator.next();
|
||||
for (JSONObject switchResultObject : (Iterable<JSONObject>) switchResult)
|
||||
draftChoiceDefinitionList.add(constructDraftChoiceDefinition(switchResultObject));
|
||||
}
|
||||
|
||||
return new DraftChoiceDefinition() {
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,7 @@ public class DefaultCardCollection implements MutableCardCollection {
|
||||
_counts.putAll(cardCollection.getAll());
|
||||
_basicItems.addAll(cardCollection.getAllCardsInCollection());
|
||||
_currency = cardCollection.getCurrency();
|
||||
_extraInformation.putAll(cardCollection.getExtraInformation());
|
||||
}
|
||||
|
||||
public synchronized void setExtraInformation(Map<String, Object> extraInformation) {
|
||||
|
||||
@@ -81,15 +81,10 @@ public class DraftLeagueData implements LeagueData {
|
||||
if (currentTime >= _serie.getStart()) {
|
||||
Map<Player, CardCollection> map = collectionsManager.getPlayersCollection(_collectionType.getCode());
|
||||
for (Map.Entry<Player, CardCollection> playerCardCollectionEntry : map.entrySet()) {
|
||||
MutableCardCollection startingCollection = new DefaultCardCollection();
|
||||
|
||||
Player player = playerCardCollectionEntry.getKey();
|
||||
CardCollection leagueProduct = _draft.initializeNewCollection(getSeed(player));
|
||||
|
||||
for (Map.Entry<String, CardCollection.Item> serieCollectionItem : leagueProduct.getAll().entrySet())
|
||||
startingCollection.addItem(serieCollectionItem.getKey(), serieCollectionItem.getValue().getCount());
|
||||
|
||||
startingCollection.setExtraInformation(createExtraInformation());
|
||||
collectionsManager.addItemsToPlayerCollection(false, "New sealed league product", player, _collectionType, leagueProduct.getAll().values());
|
||||
}
|
||||
status = 1;
|
||||
|
||||
Reference in New Issue
Block a user