move filter presets to Filter.Presets

add filter inverting
This commit is contained in:
Oth3r 2024-11-10 11:18:42 -06:00
commit de8b66d27a
4 changed files with 83 additions and 45 deletions

View file

@ -9,7 +9,7 @@ public class HandSetting {
@SerializedName("requirement")
private SittingRequirement sittingRequirement = SittingRequirement.NONE;
@SerializedName("requirement-options")
@SerializedName("requirement-options") @SuppressWarnings("unused")
private final String sittingRequirementOptions = Arrays.stream(SittingRequirement.values()).map(Enum::toString).collect(Collectors.joining(", "));
@SerializedName("filter")
private Filter filter = new Filter();
@ -37,38 +37,60 @@ public class HandSetting {
public static class Filter {
@SerializedName("block")
private boolean block = false;
@SerializedName("food")
private boolean food = false;
@SerializedName("usable")
private boolean usable = false;
@SerializedName("invert-filter")
private Boolean invert = false;
@SerializedName("presets")
private Presets presets = new Presets();
@SerializedName("custom-items")
private CustomItem customItems = new CustomItem();
public Filter() {}
public Filter(boolean block, boolean food, boolean usable, CustomItem customItems) {
this.block = block;
this.food = food;
this.usable = usable;
public Filter(boolean invert, Presets presets, CustomItem customItems) {
this.invert = invert;
this.presets = presets;
this.customItems = customItems;
}
public boolean isBlock() {
return block;
public Boolean isInverted() {
return invert;
}
public boolean isFood() {
return food;
}
public boolean isUsable() {
return usable;
public Presets getPresets() {
return presets;
}
public CustomItem getCustomItems() {
return customItems;
}
public static class Presets {
@SerializedName("block")
private boolean block = false;
@SerializedName("food")
private boolean food = false;
@SerializedName("usable")
private boolean usable = false;
public Presets() {}
public Presets(boolean block, boolean food, boolean usable) {
this.block = block;
this.food = food;
this.usable = usable;
}
public boolean isBlock() {
return block;
}
public boolean isFood() {
return food;
}
public boolean isUsable() {
return usable;
}
}
}
}