Rename CommissionType

This commit is contained in:
Patrick
2022-06-09 23:56:49 +04:00
parent cd000b68a7
commit 5632bc928d
3 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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