Rename CommissionType
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.toofifty.easygiantsfoundry;
|
||||
|
||||
import com.toofifty.easygiantsfoundry.enums.CommisionType;
|
||||
import com.toofifty.easygiantsfoundry.enums.CommissionType;
|
||||
import com.toofifty.easygiantsfoundry.enums.Mould;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ScriptID;
|
||||
@@ -40,8 +40,8 @@ public class MouldHelper
|
||||
|
||||
int bestScore = -1;
|
||||
Widget bestWidget = null;
|
||||
CommisionType type1 = CommisionType.forVarbit(client.getVarbitValue(SWORD_TYPE_1_VARBIT));
|
||||
CommisionType type2 = CommisionType.forVarbit(client.getVarbitValue(SWORD_TYPE_2_VARBIT));
|
||||
CommissionType type1 = CommissionType.forVarbit(client.getVarbitValue(SWORD_TYPE_1_VARBIT));
|
||||
CommissionType type2 = CommissionType.forVarbit(client.getVarbitValue(SWORD_TYPE_2_VARBIT));
|
||||
for (Map.Entry<Mould, Widget> entry : mouldToChild.entrySet()) {
|
||||
Mould mould = entry.getKey();
|
||||
int score = mould.getScore(type1, type2);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.toofifty.easygiantsfoundry.enums;
|
||||
|
||||
public enum CommisionType {
|
||||
public enum CommissionType {
|
||||
NONE,
|
||||
NARROW, // 1
|
||||
LIGHT, // 2
|
||||
@@ -10,12 +10,12 @@ public enum CommisionType {
|
||||
SPIKED, // 6
|
||||
;
|
||||
|
||||
public static final CommisionType[] values = CommisionType.values();
|
||||
public static final CommissionType[] values = CommissionType.values();
|
||||
|
||||
public static CommisionType forVarbit(int varbitValue) {
|
||||
public static CommissionType forVarbit(int varbitValue) {
|
||||
if (varbitValue < 0 || varbitValue >= values.length) {
|
||||
return NONE;
|
||||
}
|
||||
return CommisionType.values[varbitValue];
|
||||
return CommissionType.values[varbitValue];
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import lombok.AllArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static com.toofifty.easygiantsfoundry.enums.CommisionType.*;
|
||||
import static com.toofifty.easygiantsfoundry.enums.CommissionType.*;
|
||||
import static com.toofifty.easygiantsfoundry.enums.MouldType.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@@ -47,7 +47,7 @@ public enum Mould {
|
||||
|
||||
private final String name;
|
||||
private final MouldType mouldType;
|
||||
private final Map<CommisionType, Integer> typeToScore;
|
||||
private final Map<CommissionType, Integer> typeToScore;
|
||||
|
||||
public static final Mould[] values = Mould.values();
|
||||
|
||||
@@ -60,7 +60,7 @@ public enum Mould {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getScore(CommisionType type1, CommisionType type2) {
|
||||
public int getScore(CommissionType type1, CommissionType type2) {
|
||||
int score = 0;
|
||||
score += typeToScore.getOrDefault(type1, 0);
|
||||
score += typeToScore.getOrDefault(type2, 0);
|
||||
|
||||
Reference in New Issue
Block a user