From 3e8aa27784fd397c9254290f2b48b92208081768 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 27 Sep 2011 23:22:27 +0000 Subject: [PATCH] Adding more info to deck validation. --- .../gempukku/lotro/game/formats/DefaultLotroFormat.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java index bbdd8615a..d9a93c240 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/formats/DefaultLotroFormat.java @@ -95,16 +95,16 @@ public abstract class DefaultLotroFormat implements LotroFormat { LotroCardBlueprint cardBlueprint = _library.getLotroCardBlueprint(blueprintId); increateCount(cardCountByName, cardBlueprint.getName()); } - for (int count : cardCountByName.values()) { - if (count > _maximumSameName) - throw new DeckInvalidException("Deck contains more of the same card than allowed"); + for (Map.Entry count : cardCountByName.entrySet()) { + if (count.getValue() > _maximumSameName) + throw new DeckInvalidException("Deck contains more of the same card than allowed: " + count.getKey()); } // Restricted cards for (String name : _restrictedCard) { Integer count = cardCountByName.get(name); if (count != null && count > 1) - throw new DeckInvalidException("Deck contains more than one copy of a restricted card"); + throw new DeckInvalidException("Deck contains more than one copy of a restricted card: " + name); } } catch (IllegalArgumentException exp) {