forked from External/mage
GUI enchancements (themes, sound notification, deck validation) (#6755)
GUI enchancements (themes, sound notification, deck validation)
This commit is contained in:
parent
8c4c2728d6
commit
99d5eafc8a
128 changed files with 1988 additions and 11320 deletions
|
|
@ -13,11 +13,16 @@ import java.util.Map;
|
|||
public abstract class DeckValidator implements Serializable {
|
||||
|
||||
protected String name;
|
||||
protected String shortName;
|
||||
|
||||
protected Map<String, String> invalid = new HashMap<>();
|
||||
|
||||
public DeckValidator(String name) {
|
||||
this.name = name;
|
||||
setName(name);
|
||||
}
|
||||
|
||||
public DeckValidator(String name, String shortName) {
|
||||
setName(name, shortName);
|
||||
}
|
||||
|
||||
public abstract boolean validate(Deck deck);
|
||||
|
|
@ -26,6 +31,24 @@ public abstract class DeckValidator implements Serializable {
|
|||
return name;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
protected void setName(String name) {
|
||||
this.name = name;
|
||||
this.shortName = name.contains("-") ? name.substring(name.indexOf("-") + 1).trim() : name;
|
||||
}
|
||||
|
||||
protected void setName(String name, String shortName) {
|
||||
this.name = name;
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
protected void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public Map<String, String> getInvalid() {
|
||||
return invalid;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue