Updated some more checks to use isCreatureType.

This commit is contained in:
jendave
2011-08-06 08:24:46 +00:00
parent 9ce73a11d7
commit 992b97aa77
2 changed files with 2 additions and 6 deletions

View File

@@ -6077,9 +6077,7 @@ public class CardFactory implements NewConstants {
input[0] = JOptionPane.showInputDialog(null, "Which creature type?", "Pick type", input[0] = JOptionPane.showInputDialog(null, "Which creature type?", "Pick type",
JOptionPane.QUESTION_MESSAGE); JOptionPane.QUESTION_MESSAGE);
if(input[0].equals("Legendary") || input[0].equals("Artifact") if(!CardUtil.isCreatureType(input[0])) input[0] = "";
|| input[0].equals("Enchantment") || input[0].equals("Shrine")
|| input[0].equals("Creature")) input[0] = "";
//TODO: some more input validation, case-sensitivity, etc. //TODO: some more input validation, case-sensitivity, etc.
input[0] = input[0].trim(); //this is to prevent "cheating", and selecting multiple creature types,eg "Goblin Soldier" input[0] = input[0].trim(); //this is to prevent "cheating", and selecting multiple creature types,eg "Goblin Soldier"

View File

@@ -4010,9 +4010,7 @@ public class CardFactoryUtil {
ArrayList<String> typeList = c.getType(); ArrayList<String> typeList = c.getType();
for(String var:typeList) { for(String var:typeList) {
if(var.equals("Creature") || var.equals("Artifact") || var.equals("Land") || var.equals("Tribal") if(CardUtil.isCreatureType(var) && !map.containsKey(var)) map.put(var, 1);
|| var.equals("Enchantment") || var.equals("Legendary")) ;
else if(!map.containsKey(var)) map.put(var, 1);
else { else {
map.put(var, map.get(var) + 1); map.put(var, map.get(var) + 1);
} }