checkstyle

This commit is contained in:
jendave
2011-10-26 17:58:11 +00:00
parent ad3d7d6c86
commit 6d2615eff6
10 changed files with 321 additions and 274 deletions

View File

@@ -8,7 +8,6 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
// TODO: Auto-generated Javadoc
/** /**
* <p> * <p>
* ForgePreferences class. * ForgePreferences class.

View File

@@ -1,6 +1,5 @@
package forge.properties; package forge.properties;
// TODO: Auto-generated Javadoc
/** /**
* NewConstants.java * NewConstants.java
* *

View File

@@ -6,12 +6,16 @@ import forge.quest.data.bazaar.QuestStallManager;
import forge.quest.data.bazaar.QuestStallPurchasable; import forge.quest.data.bazaar.QuestStallPurchasable;
/** /**
* <p>Abstract QuestPetAbstract class.</p> * <p>
* Abstract QuestPetAbstract class.
* </p>
* *
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
*/ */
public abstract class QuestPetAbstract implements QuestStallPurchasable { public abstract class QuestPetAbstract implements QuestStallPurchasable {
/** The level. */
int level; int level;
private int maxLevel; private int maxLevel;
// transient here ? // transient here ?
@@ -19,188 +23,229 @@ public abstract class QuestPetAbstract implements QuestStallPurchasable {
private String description; private String description;
/** /**
* <p>getPetCard.</p> * <p>
* getPetCard.
* </p>
* *
* @return a {@link forge.Card} object. * @return a {@link forge.Card} object.
*/ */
public abstract Card getPetCard(); public abstract Card getPetCard();
/** /**
* <p>getAllUpgradePrices.</p> * <p>
* getAllUpgradePrices.
* </p>
* *
* @return an array of int. * @return an array of int.
*/ */
public abstract int[] getAllUpgradePrices(); public abstract int[] getAllUpgradePrices();
/** /**
* <p>getPrice.</p> * <p>
* getPrice.
* </p>
* *
* @return a int. * @return a int.
*/ */
public int getPrice() { public final int getPrice() {
return getAllUpgradePrices()[level]; return getAllUpgradePrices()[level];
} }
/** /**
* <p>getAllUpgradeDescriptions.</p> * <p>
* getAllUpgradeDescriptions.
* </p>
* *
* @return an array of {@link java.lang.String} objects. * @return an array of {@link java.lang.String} objects.
*/ */
public abstract String[] getAllUpgradeDescriptions(); public abstract String[] getAllUpgradeDescriptions();
/** /**
* <p>getUpgradeDescription.</p> * <p>
* getUpgradeDescription.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public String getUpgradeDescription() { public final String getUpgradeDescription() {
return getAllUpgradeDescriptions()[level]; return getAllUpgradeDescriptions()[level];
} }
/** /**
* <p>getAllImageNames.</p> * <p>
* getAllImageNames.
* </p>
* *
* @return an array of {@link java.lang.String} objects. * @return an array of {@link java.lang.String} objects.
*/ */
public abstract String[] getAllImageNames(); public abstract String[] getAllImageNames();
/** /**
* <p>getImageName.</p> * <p>
* getImageName.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public String getImageName() { public final String getImageName() {
return getAllImageNames()[level]; return getAllImageNames()[level];
} }
/** /**
* <p>getAllStats.</p> * <p>
* getAllStats.
* </p>
* *
* @return an array of {@link java.lang.String} objects. * @return an array of {@link java.lang.String} objects.
*/ */
public abstract String[] getAllStats(); public abstract String[] getAllStats();
/** /**
* <p>getStats.</p> * <p>
* getStats.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public String getStats() { public final String getStats() {
return getAllStats()[level]; return getAllStats()[level];
} }
/** /**
* <p>getUpgradedStats.</p> * <p>
* getUpgradedStats.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public String getUpgradedStats() { public final String getUpgradedStats() {
return getAllStats()[level + 1]; return getAllStats()[level + 1];
} }
/** /**
* <p>Getter for the field <code>level</code>.</p> * <p>
* Getter for the field <code>level</code>.
* </p>
* *
* @return a int. * @return a int.
*/ */
public int getLevel() { public final int getLevel() {
return level; return level;
} }
/** /**
* <p>incrementLevel.</p> * <p>
* incrementLevel.
* </p>
*/ */
public void incrementLevel() { public final void incrementLevel() {
if (level < maxLevel) { if (level < maxLevel) {
level++; level++;
} }
} }
/** /**
* <p>Getter for the field <code>maxLevel</code>.</p> * <p>
* Getter for the field <code>maxLevel</code>.
* </p>
* *
* @return a int. * @return a int.
*/ */
public int getMaxLevel() { public final int getMaxLevel() {
return maxLevel; return maxLevel;
} }
/** /**
* <p>Constructor for QuestPetAbstract.</p> * <p>
* Constructor for QuestPetAbstract.
* </p>
* *
* @param name a {@link java.lang.String} object. * @param name
* @param description a {@link java.lang.String} object. * a {@link java.lang.String} object.
* @param maxLevel a int. * @param description
* a {@link java.lang.String} object.
* @param maxLevel
* a int.
*/ */
protected QuestPetAbstract(String name, String description, int maxLevel) { protected QuestPetAbstract(final String name, final String description, final int maxLevel) {
this.description = description; this.description = description;
this.name = name; this.name = name;
this.maxLevel = maxLevel; this.maxLevel = maxLevel;
} }
/** /**
* <p>Setter for the field <code>level</code>.</p> * <p>
* Setter for the field <code>level</code>.
* </p>
* *
* @param level a int. * @param level
* a int.
*/ */
public void setLevel(int level) { public final void setLevel(final int level) {
this.level = level; this.level = level;
} }
/** /**
* <p>getPurchaseDescription.</p> * <p>
* getPurchaseDescription.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public String getPurchaseDescription() { public final String getPurchaseDescription() {
return "<em>" + getDescription() + "</em><br>" + getUpgradeDescription() + return "<em>" + getDescription() + "</em><br>" + getUpgradeDescription() + "<br><br><u>Current stats:</u> "
"<br><br><u>Current stats:</u> " + getStats() + + getStats() + "<br><u>Upgraded stats:</u> " + getUpgradedStats();
"<br><u>Upgraded stats:</u> " + getUpgradedStats();
} }
/** /**
* <p>Getter for the field <code>description</code>.</p> * <p>
* Getter for the field <code>description</code>.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public String getDescription() { public final String getDescription() {
return description; return description;
} }
/** /**
* <p>Getter for the field <code>name</code>.</p> * <p>
* Getter for the field <code>name</code>.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public String getName() { public final String getName() {
return name; return name;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String toString() { public final String toString() {
return name; return name;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
public int compareTo(Object o) { public final int compareTo(final Object o) {
return name.compareTo(o.toString()); return name.compareTo(o.toString());
} }
/** /**
* <p>getPurchaseName.</p> * <p>
* getPurchaseName.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public String getPurchaseName() { public final String getPurchaseName() {
return name; return name;
} }
/** /**
* <p>getStallName.</p> * <p>
* getStallName.
* </p>
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
@@ -209,7 +254,9 @@ public abstract class QuestPetAbstract implements QuestStallPurchasable {
} }
/** /**
* <p>isAvailableForPurchase.</p> * <p>
* isAvailableForPurchase.
* </p>
* *
* @return a boolean. * @return a boolean.
*/ */
@@ -222,7 +269,9 @@ public abstract class QuestPetAbstract implements QuestStallPurchasable {
} }
/** /**
* <p>onPurchase.</p> * <p>
* onPurchase.
* </p>
*/ */
public void onPurchase() { public void onPurchase() {
AllZone.getQuestData().getPetManager().addPetLevel(name); AllZone.getQuestData().getPetManager().addPetLevel(name);

View File

@@ -4,7 +4,9 @@ import forge.AllZone;
import forge.Card; import forge.Card;
/** /**
* <p>QuestPetBird class.</p> * <p>
* QuestPetBird class.
* </p>
* *
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
@@ -12,7 +14,7 @@ import forge.Card;
public class QuestPetBird extends QuestPetAbstract { public class QuestPetBird extends QuestPetAbstract {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public Card getPetCard() { public final Card getPetCard() {
Card petCard = new Card(); Card petCard = new Card();
petCard.setName("Bird Pet"); petCard.setName("Bird Pet");
@@ -28,7 +30,6 @@ public class QuestPetBird extends QuestPetAbstract {
petCard.addIntrinsicKeyword("Flying"); petCard.addIntrinsicKeyword("Flying");
if (level == 1) { if (level == 1) {
petCard.setImageName("W 0 1 Bird Pet"); petCard.setImageName("W 0 1 Bird Pet");
petCard.setBaseAttack(0); petCard.setBaseAttack(0);
@@ -52,50 +53,39 @@ public class QuestPetBird extends QuestPetAbstract {
} }
/** /**
* <p>Constructor for QuestPetBird.</p> * <p>
* Constructor for QuestPetBird.
* </p>
*/ */
public QuestPetBird() { public QuestPetBird() {
super("Bird", super("Bird", "Unmatched in speed, agility and awareness, this trained hawk makes a fantastic hunter.", 4);
"Unmatched in speed, agility and awareness, this trained hawk makes a fantastic hunter.",
4);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public int[] getAllUpgradePrices() { public final int[] getAllUpgradePrices() {
return new int[] { 200, 300, 450, 400 }; return new int[] { 200, 300, 450, 400 };
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllUpgradeDescriptions() { public final String[] getAllUpgradeDescriptions() {
return new String[]{ return new String[] {"Purchase Bird", "Improve the attack power of your bird.",
"Purchase Bird", "Improve the attack power of your bird.", "Give First Strike to your bird.",
"Improve the attack power of your bird.",
"Improve the attack power of your bird.",
"Give First Strike to your bird.",
"You cannot train your bird any further"}; "You cannot train your bird any further"};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllStats() { public final String[] getAllStats() {
return new String[]{"You do not own a bird", return new String[] {"You do not own a bird", "0/1, W, Flying", "1/1, W, Flying", "2/1, W, Flying",
"0/1, W, Flying",
"1/1, W, Flying",
"2/1, W, Flying",
"2/1, W, Flying, First Strike"}; "2/1, W, Flying, First Strike"};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllImageNames() { public final String[] getAllImageNames() {
return new String[]{ return new String[] {"", "w_0_1_bird_pet_small.jpg", "w_1_1_bird_pet_small.jpg", "w_2_1_bird_pet_small.jpg",
"", "w_2_1_bird_pet_first_strike_small.jpg"};
"w_0_1_bird_pet_small.jpg",
"w_1_1_bird_pet_small.jpg",
"w_2_1_bird_pet_small.jpg",
"w_2_1_bird_pet_first_strike_small.jpg"
};
} }
} }

View File

@@ -4,7 +4,9 @@ import forge.AllZone;
import forge.Card; import forge.Card;
/** /**
* <p>QuestPetCrocodile class.</p> * <p>
* QuestPetCrocodile class.
* </p>
* *
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
@@ -12,7 +14,7 @@ import forge.Card;
public class QuestPetCrocodile extends QuestPetAbstract { public class QuestPetCrocodile extends QuestPetAbstract {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public Card getPetCard() { public final Card getPetCard() {
Card petCard = new Card(); Card petCard = new Card();
petCard.setName("Crocodile Pet"); petCard.setName("Crocodile Pet");
petCard.addController(AllZone.getHumanPlayer()); petCard.addController(AllZone.getHumanPlayer());
@@ -44,55 +46,42 @@ public class QuestPetCrocodile extends QuestPetAbstract {
petCard.addIntrinsicKeyword("Swampwalk"); petCard.addIntrinsicKeyword("Swampwalk");
} }
return petCard; return petCard;
} }
/** /**
* <p>Constructor for QuestPetCrocodile.</p> * <p>
* Constructor for QuestPetCrocodile.
* </p>
*/ */
public QuestPetCrocodile() { public QuestPetCrocodile() {
super("Crocodile", super("Crocodile", "With its razor sharp teeth, this swamp-dwelling monster is extremely dangerous.", 4);
"With its razor sharp teeth, this swamp-dwelling monster is extremely dangerous.",
4);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public int[] getAllUpgradePrices() { public final int[] getAllUpgradePrices() {
return new int[] { 250, 300, 450, 600 }; return new int[] { 250, 300, 450, 600 };
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllUpgradeDescriptions() { public final String[] getAllUpgradeDescriptions() {
return new String[]{ return new String[] {"Purchase Crocodile", "Improve the attack power of your crocodile.",
"Purchase Crocodile", "Improve the attack power of your crocodile.", "Give Swampwalking to your crocodile.",
"Improve the attack power of your crocodile.",
"Improve the attack power of your crocodile.",
"Give Swampwalking to your crocodile.",
"You cannot train your crocodile any further"}; "You cannot train your crocodile any further"};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllStats() { public final String[] getAllStats() {
return new String[]{"You do not own a crocodile", return new String[] {"You do not own a crocodile", "1/1, B", "2/1, B", "3/1, B", "3/1, B, Swampwalking"};
"1/1, B",
"2/1, B",
"3/1, B",
"3/1, B, Swampwalking"};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllImageNames() { public final String[] getAllImageNames() {
return new String[]{ return new String[] {"", "b_1_1_crocodile_pet_small.jpg", "b_2_1_crocodile_pet_small.jpg",
"", "b_3_1_crocodile_pet_small.jpg", "b_3_1_crocodile_pet_swampwalk_small.jpg"};
"b_1_1_crocodile_pet_small.jpg",
"b_2_1_crocodile_pet_small.jpg",
"b_3_1_crocodile_pet_small.jpg",
"b_3_1_crocodile_pet_swampwalk_small.jpg"
};
} }
} }

View File

@@ -7,14 +7,18 @@ import forge.card.trigger.Trigger;
import forge.card.trigger.TriggerHandler; import forge.card.trigger.TriggerHandler;
/** /**
* <p>QuestPetHound class.</p> * <p>
* QuestPetHound class.
* </p>
* *
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
*/ */
public class QuestPetHound extends QuestPetAbstract { public class QuestPetHound extends QuestPetAbstract {
/** /**
* <p>Constructor for QuestPetHound.</p> * <p>
* Constructor for QuestPetHound.
* </p>
*/ */
public QuestPetHound() { public QuestPetHound() {
super("Hound", "Dogs are said to be man's best friend. Definitely not this one.", 4); super("Hound", "Dogs are said to be man's best friend. Definitely not this one.", 4);
@@ -22,7 +26,7 @@ public class QuestPetHound extends QuestPetAbstract {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public Card getPetCard() { public final Card getPetCard() {
Card petCard = new Card(); Card petCard = new Card();
petCard.setName("Hound Pet"); petCard.setName("Hound Pet");
@@ -57,52 +61,43 @@ public class QuestPetHound extends QuestPetAbstract {
petCard.setBaseDefense(1); petCard.setBaseDefense(1);
petCard.addIntrinsicKeyword("Haste"); petCard.addIntrinsicKeyword("Haste");
final Trigger myTrigger = TriggerHandler.parseTrigger("Mode$ Attacks | ValidCard$ Card.Self | Alone$ True | TriggerDescription$ Whenever CARDNAME attacks alone, it gets +2/+0 until end of turn.", petCard,true); final Trigger myTrigger = TriggerHandler
.parseTrigger(
"Mode$ Attacks | ValidCard$ Card.Self | Alone$ True | TriggerDescription$ Whenever CARDNAME attacks alone, it gets +2/+0 until end of turn.",
petCard, true);
AbilityFactory af = new AbilityFactory(); AbilityFactory af = new AbilityFactory();
myTrigger.setOverridingAbility(af.getAbility("AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2", petCard)); myTrigger.setOverridingAbility(af.getAbility("AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2", petCard));
petCard.addTrigger(myTrigger); petCard.addTrigger(myTrigger);
} }
return petCard; return petCard;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public int[] getAllUpgradePrices() { public final int[] getAllUpgradePrices() {
return new int[] { 200, 350, 450, 750 }; return new int[] { 200, 350, 450, 750 };
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllUpgradeDescriptions() { public final String[] getAllUpgradeDescriptions() {
return new String[]{ return new String[] {"Purchase hound", "Give Haste to your hound.", "Improve the attack power of your hound.",
"Purchase hound",
"Give Haste to your hound.",
"Improve the attack power of your hound.",
"Greatly improves your hound's attack power if it attacks alone.", "Greatly improves your hound's attack power if it attacks alone.",
"You cannot train your hound any further"}; "You cannot train your hound any further"};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllStats() { public final String[] getAllStats() {
return new String[]{"You do not own a hound", return new String[] {"You do not own a hound", "1/1, R", "1/1, R, Haste", "2/1, R, Haste",
"1/1, R",
"1/1, R, Haste",
"2/1, R, Haste",
"2/1, R, Haste, Whenever this creature attacks alone, it gets +2/+0 until end of turn."}; "2/1, R, Haste, Whenever this creature attacks alone, it gets +2/+0 until end of turn."};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllImageNames() { public final String[] getAllImageNames() {
return new String[]{ return new String[] {"", "r_1_1_hound_pet_small.jpg", "r_1_1_hound_pet_haste_small.jpg",
"", "r_2_1_hound_pet_small.jpg", "r_2_1_hound_pet_alone_small.jpg"};
"r_1_1_hound_pet_small.jpg",
"r_1_1_hound_pet_haste_small.jpg",
"r_2_1_hound_pet_small.jpg",
"r_2_1_hound_pet_alone_small.jpg"
};
} }
} }

View File

@@ -1,22 +1,39 @@
package forge.quest.data.pet; package forge.quest.data.pet;
import java.util.*; import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
/** /**
* <p>QuestPetManager class.</p> * <p>
* QuestPetManager class.
* </p>
* *
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
*/ */
public class QuestPetManager { public class QuestPetManager {
/** The pets. */
public Map<String, QuestPetAbstract> pets = new HashMap<String, QuestPetAbstract>(); public Map<String, QuestPetAbstract> pets = new HashMap<String, QuestPetAbstract>();
/** The selected pet. */
public QuestPetAbstract selectedPet; public QuestPetAbstract selectedPet;
/** The plant. */
public QuestPetAbstract plant; public QuestPetAbstract plant;
/** The use plant. */
public boolean usePlant; public boolean usePlant;
/** /**
* <p>Constructor for QuestPetManager.</p> * <p>
* Constructor for QuestPetManager.
* </p>
*/ */
public QuestPetManager() { public QuestPetManager() {
plant = new QuestPetPlant(); plant = new QuestPetPlant();
@@ -26,36 +43,45 @@ public class QuestPetManager {
} }
/** /**
* <p>Setter for the field <code>selectedPet</code>.</p> * <p>
* Setter for the field <code>selectedPet</code>.
* </p>
* *
* @param pet a {@link java.lang.String} object. * @param pet
* a {@link java.lang.String} object.
*/ */
public void setSelectedPet(String pet) { public final void setSelectedPet(final String pet) {
selectedPet = (pet == null) ? null : getPet(pet); selectedPet = (pet == null) ? null : getPet(pet);
} }
/** /**
* <p>Getter for the field <code>selectedPet</code>.</p> * <p>
* Getter for the field <code>selectedPet</code>.
* </p>
* *
* @return a {@link forge.quest.data.pet.QuestPetAbstract} object. * @return a {@link forge.quest.data.pet.QuestPetAbstract} object.
*/ */
public QuestPetAbstract getSelectedPet() { public final QuestPetAbstract getSelectedPet() {
return selectedPet; return selectedPet;
} }
/** /**
* <p>Getter for the field <code>plant</code>.</p> * <p>
* Getter for the field <code>plant</code>.
* </p>
* *
* @return a {@link forge.quest.data.pet.QuestPetAbstract} object. * @return a {@link forge.quest.data.pet.QuestPetAbstract} object.
*/ */
public QuestPetAbstract getPlant() { public final QuestPetAbstract getPlant() {
return plant; return plant;
} }
/** /**
* <p>addPlantLevel.</p> * <p>
* addPlantLevel.
* </p>
*/ */
public void addPlantLevel() { public final void addPlantLevel() {
if (plant == null) { if (plant == null) {
plant = new QuestPetPlant(); plant = new QuestPetPlant();
} else { } else {
@@ -64,63 +90,80 @@ public class QuestPetManager {
} }
/** /**
* <p>getPet.</p> * <p>
* getPet.
* </p>
* *
* @param petName a {@link java.lang.String} object. * @param petName
* a {@link java.lang.String} object.
* @return a {@link forge.quest.data.pet.QuestPetAbstract} object. * @return a {@link forge.quest.data.pet.QuestPetAbstract} object.
*/ */
public QuestPetAbstract getPet(String petName) { public final QuestPetAbstract getPet(final String petName) {
return pets.get(petName); return pets.get(petName);
} }
/** /**
* <p>addPet.</p> * <p>
* addPet.
* </p>
* *
* @param newPet a {@link forge.quest.data.pet.QuestPetAbstract} object. * @param newPet
* a {@link forge.quest.data.pet.QuestPetAbstract} object.
*/ */
public void addPet(QuestPetAbstract newPet) { public final void addPet(final QuestPetAbstract newPet) {
pets.put(newPet.getName(), newPet); pets.put(newPet.getName(), newPet);
} }
/** /**
* <p>getPetNames.</p> * <p>
* getPetNames.
* </p>
* *
* @return a {@link java.util.Set} object. * @return a {@link java.util.Set} object.
*/ */
public Set<String> getPetNames() { public final Set<String> getPetNames() {
return pets.keySet(); return pets.keySet();
} }
/** /**
* <p>addPetLevel.</p> * <p>
* addPetLevel.
* </p>
* *
* @param s a {@link java.lang.String} object. * @param s
* a {@link java.lang.String} object.
*/ */
public void addPetLevel(String s) { public final void addPetLevel(final String s) {
pets.get(s).incrementLevel(); pets.get(s).incrementLevel();
} }
/** /**
* <p>shouldPlantBeUsed.</p> * <p>
* shouldPlantBeUsed.
* </p>
* *
* @return a boolean. * @return a boolean.
*/ */
public boolean shouldPlantBeUsed() { public final boolean shouldPlantBeUsed() {
return usePlant; return usePlant;
} }
/** /**
* <p>shouldPetBeUsed.</p> * <p>
* shouldPetBeUsed.
* </p>
* *
* @return a boolean. * @return a boolean.
*/ */
public boolean shouldPetBeUsed() { public final boolean shouldPetBeUsed() {
return selectedPet != null; return selectedPet != null;
} }
/** /**
* <p>getAllPets.</p> * <p>
* getAllPets.
* </p>
* *
* @return a {@link java.util.Set} object. * @return a {@link java.util.Set} object.
*/ */
@@ -135,13 +178,14 @@ public class QuestPetManager {
return set; return set;
} }
/** /**
* <p>getAvailablePetNames.</p> * <p>
* getAvailablePetNames.
* </p>
* *
* @return a {@link java.util.Set} object. * @return a {@link java.util.Set} object.
*/ */
public Set<String> getAvailablePetNames() { public final Set<String> getAvailablePetNames() {
SortedSet<String> set = new TreeSet<String>(); SortedSet<String> set = new TreeSet<String>();
for (Map.Entry<String, QuestPetAbstract> pet : pets.entrySet()) { for (Map.Entry<String, QuestPetAbstract> pet : pets.entrySet()) {
if (pet.getValue().getLevel() > 0) { if (pet.getValue().getLevel() > 0) {
@@ -151,13 +195,14 @@ public class QuestPetManager {
return set; return set;
} }
/** /**
* <p>getPetsAndPlants.</p> * <p>
* getPetsAndPlants.
* </p>
* *
* @return a {@link java.util.Collection} object. * @return a {@link java.util.Collection} object.
*/ */
public Collection<QuestPetAbstract> getPetsAndPlants() { public final Collection<QuestPetAbstract> getPetsAndPlants() {
Set<QuestPetAbstract> petsAndPlants = new HashSet<QuestPetAbstract>(pets.values()); Set<QuestPetAbstract> petsAndPlants = new HashSet<QuestPetAbstract>(pets.values());
petsAndPlants.add(plant); petsAndPlants.add(plant);
@@ -166,7 +211,9 @@ public class QuestPetManager {
// Magic to support added pet types when reading saves. // Magic to support added pet types when reading saves.
/** /**
* <p>readResolve.</p> * <p>
* readResolve.
* </p>
* *
* @return a {@link java.lang.Object} object. * @return a {@link java.lang.Object} object.
*/ */

View File

@@ -9,7 +9,9 @@ import forge.card.spellability.SpellAbility;
import forge.quest.data.bazaar.QuestStallManager; import forge.quest.data.bazaar.QuestStallManager;
/** /**
* <p>QuestPetPlant class.</p> * <p>
* QuestPetPlant class.
* </p>
* *
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
@@ -17,7 +19,7 @@ import forge.quest.data.bazaar.QuestStallManager;
public class QuestPetPlant extends QuestPetAbstract { public class QuestPetPlant extends QuestPetAbstract {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public Card getPetCard() { public final Card getPetCard() {
final Card petCard = new Card(); final Card petCard = new Card();
petCard.setName("Plant Wall"); petCard.setName("Plant Wall");
@@ -62,7 +64,6 @@ public class QuestPetPlant extends QuestPetAbstract {
petCard.setBaseDefense(4); petCard.setBaseDefense(4);
petCard.addIntrinsicKeyword("Deathtouch"); petCard.addIntrinsicKeyword("Deathtouch");
Cost abCost = new Cost("T", petCard.getName(), true); Cost abCost = new Cost("T", petCard.getName(), true);
final SpellAbility ability = new Ability_Activated(petCard, abCost, null) { final SpellAbility ability = new Ability_Activated(petCard, abCost, null) {
private static final long serialVersionUID = 7546242087593613719L; private static final long serialVersionUID = 7546242087593613719L;
@@ -87,33 +88,32 @@ public class QuestPetPlant extends QuestPetAbstract {
petCard.setText("tap: You gain 1 life."); petCard.setText("tap: You gain 1 life.");
} }
return petCard; return petCard;
} }
/** /**
* <p>Constructor for QuestPetPlant.</p> * <p>
* Constructor for QuestPetPlant.
* </p>
*/ */
public QuestPetPlant() { public QuestPetPlant() {
super("Plant", super(
"Plant",
"Start each of your battles with this lush, verdant plant on your side. Excellent at blocking the nastiest of critters!", "Start each of your battles with this lush, verdant plant on your side. Excellent at blocking the nastiest of critters!",
6); 6);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public int[] getAllUpgradePrices() { public final int[] getAllUpgradePrices() {
return new int[] { 100, 150, 200, 300, 750, 1000 }; return new int[] { 100, 150, 200, 300, 750, 1000 };
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllUpgradeDescriptions() { public final String[] getAllUpgradeDescriptions() {
return new String[]{ return new String[] { "Purchase Plant", "Improve the defense power of your plant.",
"Purchase Plant", "Improve the defense power of your plant.", "Improve the defense power of your plant.",
"Improve the defense power of your plant.",
"Improve the defense power of your plant.",
"Improve the defense power of your plant.",
"Grow venomous thorns on your plant.", "Grow venomous thorns on your plant.",
"Improve the defense power of your plant and your plant will have healing properties", "Improve the defense power of your plant and your plant will have healing properties",
"You cannot train your plant any further" }; "You cannot train your plant any further" };
@@ -121,45 +121,34 @@ public class QuestPetPlant extends QuestPetAbstract {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllStats() { public final String[] getAllStats() {
return new String[]{"You do not own a plant", return new String[] { "You do not own a plant", "0/1, G, Defender", "0/2, G, Defender", "0/3, G, Defender",
"0/1, G, Defender", "1/3, G, Defender", "1/3, G, Defender, Deathtouch", "1/4, G, Defender, Deathtouch, T: Gain 1 life" };
"0/2, G, Defender",
"0/3, G, Defender",
"1/3, G, Defender",
"1/3, G, Defender, Deathtouch",
"1/4, G, Defender, Deathtouch, T: Gain 1 life"};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllImageNames() { public final String[] getAllImageNames() {
return new String[]{ return new String[] { "", "g_0_1_plant_wall_small.jpg", "g_0_2_plant_wall_small.jpg",
"", "g_0_3_plant_wall_small.jpg", "g_1_3_plant_wall_small.jpg", "g_1_3_plant_wall_deathtouch_small",
"g_0_1_plant_wall_small.jpg", "g_1_4_plant_wall_small.jpg" };
"g_0_2_plant_wall_small.jpg",
"g_0_3_plant_wall_small.jpg",
"g_1_3_plant_wall_small.jpg",
"g_1_3_plant_wall_deathtouch_small",
"g_1_4_plant_wall_small.jpg"
};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String getStallName() { public final String getStallName() {
return QuestStallManager.NURSERY; return QuestStallManager.NURSERY;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void onPurchase() { public final void onPurchase() {
AllZone.getQuestData().getPetManager().addPlantLevel(); AllZone.getQuestData().getPetManager().addPlantLevel();
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public boolean isAvailableForPurchase() { public final boolean isAvailableForPurchase() {
QuestPetPlant plant = (QuestPetPlant) AllZone.getQuestData().getPetManager().getPlant(); QuestPetPlant plant = (QuestPetPlant) AllZone.getQuestData().getPetManager().getPlant();
return plant == null || plant.getLevel() < plant.getMaxLevel(); return plant == null || plant.getLevel() < plant.getMaxLevel();

View File

@@ -4,7 +4,9 @@ import forge.AllZone;
import forge.Card; import forge.Card;
/** /**
* <p>QuestPetWolf class.</p> * <p>
* QuestPetWolf class.
* </p>
* *
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
@@ -12,7 +14,7 @@ import forge.Card;
public class QuestPetWolf extends QuestPetAbstract { public class QuestPetWolf extends QuestPetAbstract {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public Card getPetCard() { public final Card getPetCard() {
Card petCard = new Card(); Card petCard = new Card();
petCard.setName("Wolf Pet"); petCard.setName("Wolf Pet");
@@ -49,50 +51,38 @@ public class QuestPetWolf extends QuestPetAbstract {
} }
/** /**
* <p>Constructor for QuestPetWolf.</p> * <p>
* Constructor for QuestPetWolf.
* </p>
*/ */
public QuestPetWolf() { public QuestPetWolf() {
super("Wolf", super("Wolf", "This ferocious animal may have been raised in captivity, but it has been trained to kill.", 4);
"This ferocious animal may have been raised in captivity, but it has been trained to kill.",
4);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public int[] getAllUpgradePrices() { public final int[] getAllUpgradePrices() {
return new int[] { 250, 250, 500, 550 }; return new int[] { 250, 250, 500, 550 };
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllUpgradeDescriptions() { public final String[] getAllUpgradeDescriptions() {
return new String[]{ return new String[] {"Purchase Wolf", "Improve the attack power of your wolf.",
"Purchase Wolf", "Improve the defense power of your wolf.", "Give Flanking to your wolf.",
"Improve the attack power of your wolf.",
"Improve the defense power of your wolf.",
"Give Flanking to your wolf.",
"You cannot train your wolf any further"}; "You cannot train your wolf any further"};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllStats() { public final String[] getAllStats() {
return new String[]{"You do not own a wolf", return new String[] {"You do not own a wolf", "1/1, G", "1/2, G", "2/2, G", "2/2, G, Flanking"};
"1/1, G",
"1/2, G",
"2/2, G",
"2/2, G, Flanking"};
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public String[] getAllImageNames() { public final String[] getAllImageNames() {
return new String[]{ return new String[] {"", "g_1_1_wolf_pet_small.jpg", "g_1_2_wolf_pet_small.jpg", "g_2_2_wolf_pet_small.jpg",
"", "g_2_2_wolf_pet_flanking_small.jpg"};
"g_1_1_wolf_pet_small.jpg",
"g_1_2_wolf_pet_small.jpg",
"g_2_2_wolf_pet_small.jpg",
"g_2_2_wolf_pet_flanking_small.jpg"
};
} }
} }

View File

@@ -1,2 +1,2 @@
/** Forge Card Game */ /** Forge Card Game. */
package forge.quest.data.pet; package forge.quest.data.pet;