Update gifts manager

This commit is contained in:
JW
2024-02-25 21:02:39 +01:00
parent b809bb6cda
commit 63dd8c20ac
65 changed files with 51 additions and 189131 deletions

View File

@@ -7,9 +7,8 @@ import lombok.*;
import java.util.*;
@Data
@AllArgsConstructor
public class Gift {
public static final Gift UNDEFINED = new Gift(-1, "undefined", -1, "", null);
public static final Gift UNDEFINED = new Gift(-1, "undefined", -1, "");
private final int id;
@@ -21,28 +20,21 @@ public class Gift {
private final JsonObject properties;
public Gift(int id, String name, int diamondCost, String pictureLink, JsonObject properties) {
public Gift(int id, String name, int diamondCost, Picture pictureLink, JsonObject properties) {
this.id = id;
this.name = name;
this.diamondCost = diamondCost;
this.picture = new Picture(pictureLink);
this.picture = pictureLink;
this.properties = properties;
}
public Gift(int id, String name, int diamondCost, String pictureLink) {
this.id = id;
this.name = name;
this.diamondCost = diamondCost;
this.picture = new Picture(pictureLink);
this.properties = new JsonObject();
this(id, name, diamondCost, new Picture(pictureLink), new JsonObject());
}
public Gift(int id, String name, int diamondCost, Picture picture) {
this.id = id;
this.name = name;
this.diamondCost = diamondCost;
this.picture = picture;
this.properties = new JsonObject();
this(id, name, diamondCost, picture, new JsonObject());
}
public boolean hasDiamondCostRange(int minimalCost, int maximalCost) {