GUI enchancements (themes, sound notification, deck validation) (#6755)

GUI enchancements (themes, sound notification, deck validation)
This commit is contained in:
18ths 2020-07-17 19:15:02 +02:00 committed by GitHub
parent 8c4c2728d6
commit 99d5eafc8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
128 changed files with 1988 additions and 11320 deletions

View file

@ -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;
}