21public enum Allotment implements Plant {
22 POTATO(5318, 1942, 5096, 3, 1,
new int[] {6032, 2}, 40, 8, 9.5, 6, 12,
InspectMessage.POTATOES),
23 ONION(5319, 1957, 5096, 3, 5,
new int[] {5438, 1}, 40, 9.5, 10.5, 13, 19,
InspectMessage.ONIONS),
24 CABBAGE(5324, 1965, 5097, 3, 7,
new int[] {5458, 1}, 40, 10, 11.5, 20, 26,
InspectMessage.CABBAGES),
25 TOMATO(5322, 1982, 5096, 3, 12,
new int[] {5478, 2}, 40, 12.5, 14, 27, 33,
InspectMessage.TOMATOES),
26 SWEETCORN(5320, 5986, 6059, 3, 20,
new int[] {5931, 10}, 40, 17, 19, 34, 42,
InspectMessage.SWEETCORNS),
27 STRAWBERRY(5323, 5504, -1, 3, 31,
new int[] {5386, 1}, 40, 26, 29, 43, 49,
InspectMessage.STRAWBERRIES),
28 WATERMELON(5321, 5982, 5098, 3, 47,
new int[] {5970, 10}, 40, 48.5, 54.5, 52, 60,
InspectMessage.WATERMELONS);
30 private final int seedId;
31 private final int harvestId;
32 private final int flowerProtect;
33 private final int seedAmount;
34 private final int levelRequired;
35 private final int[] paymentToWatch;
36 private final int growthTime;
37 private final double plantingXp;
38 private final double harvestXp;
39 private final int startingState;
40 private final int endingState;
43 private static final Map<Integer, Allotment> ALLOTMENTS =
new HashMap<>();
46 for (Allotment data : Allotment.values()) {
47 ALLOTMENTS.put(data.seedId, data);
51 Allotment(
int seedId,
int harvestId,
int flowerProtect,
int seedAmount,
int levelRequired,
int[] paymentToWatch,
int growthTime,
double plantingXp,
double harvestXp,
int startingState,
int endingState,
InspectMessage inspect) {
53 this.harvestId = harvestId;
54 this.flowerProtect = flowerProtect;
55 this.seedAmount = seedAmount;
56 this.levelRequired = levelRequired;
57 this.paymentToWatch = paymentToWatch;
58 this.growthTime = growthTime;
59 this.plantingXp = plantingXp;
60 this.harvestXp = harvestXp;
61 this.startingState = startingState;
62 this.endingState = endingState;
63 this.inspect = inspect;
66 public static Allotment forId(
int seedId) {
67 return ALLOTMENTS.get(seedId);
71 public int getSeedId() {
76 public int getHarvestId() {
81 public int getFlowerProtect() {
86 public int getSeedAmount() {
91 public int getLevelRequired() {
96 public int[] getPaymentToWatch() {
97 return paymentToWatch;
101 public int getGrowthTime() {
108 public double getPlantingXp() {
113 public double getHarvestXp() {
118 public int getStartingState() {
119 return startingState;
123 public int getEndingState() {
128 public String getProductType() {
129 return name().toLowerCase();
133 public String[][] getInspectMessages() {
134 return inspect.getMessages();