works somehow - only the second game starts properly

This commit is contained in:
Maxmtg
2012-03-18 19:47:31 +00:00
parent 3df1ae8a4c
commit b6e746eabf
3 changed files with 14 additions and 26 deletions

View File

@@ -385,8 +385,7 @@ public class CardReader implements Runnable {
* @param mapToFill is used to eliminate duplicates
* @return the card
*/
public static Card readCard(final Iterable<String> lines, final CardRulesReader rulesReader,
final Map<String, Card> mapToFill) {
public static Card readCard(final Iterable<String> lines, final CardRulesReader rulesReader, final Map<String, Card> mapToFill) {
final Card card = new Card();
boolean ignoreTheRest = false;

View File

@@ -96,10 +96,7 @@ public class QuestUtil {
if (pet != null) {
Card c = pet.getPetCard(qc.getAssets());
if ( c != null ){
Card petCard = AbstractCardFactory.getCard2(c, AllZone.getHumanPlayer());
petCard.addController(AllZone.getHumanPlayer());
petCard.setToken(true);
// list.add(petCard);
list.add(c);
}
}
}

View File

@@ -27,29 +27,21 @@ public class QuestPetStats {
@XStreamAsAttribute()
@XStreamAlias(value = "pic")
private final String picture;
private String picture;
@XStreamAsAttribute()
private final String stats;
private String stats;
@XStreamAsAttribute()
private final String cardFile;
private String cardFile;
@XStreamAsAttribute()
private int cost;
@XStreamAsAttribute()
private final String nextLevel;
private String nextLevel;
private transient Card petCard;
public QuestPetStats()
{
picture = null;
stats = null;
cardFile = null;
nextLevel = null;
}
private QuestPetStats() { }
public final int getLevelValue() {
return levelValue;
@@ -64,13 +56,13 @@ public class QuestPetStats {
}
public final Card getCard() {
if ( petCard == null ) {
List<String> cardLines = FileUtil.readFile(new File(ForgeProps.getFile(NewConstants.Quest.BAZAAR_DIR), cardFile));
petCard = CardReader.readCard(cardLines);
petCard.setImageFilename(picture);
petCard.setToken(true);
petCard.setOwner(AllZone.getHumanPlayer());
}
List<String> cardLines = FileUtil.readFile(new File(ForgeProps.getFile(NewConstants.Quest.BAZAAR_DIR), cardFile));
Card petCard = CardReader.readCard(cardLines);
petCard.setImageFilename(picture.replace('_', ' '));
petCard.setToken(true);
petCard.addController(AllZone.getHumanPlayer());
petCard.setOwner(AllZone.getHumanPlayer());
petCard.setSickness(true);
return petCard;
}