raidsthieving: use interface instead of type

This commit is contained in:
sdburns1998
2019-07-07 18:16:17 +02:00
parent 6d093db66d
commit db978d6c67
2 changed files with 6 additions and 5 deletions

View File

@@ -29,6 +29,7 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import static net.runelite.client.plugins.raidsthieving.BatSolver.SolutionSet.SOLUTION_SETS; import static net.runelite.client.plugins.raidsthieving.BatSolver.SolutionSet.SOLUTION_SETS;
@@ -37,7 +38,7 @@ public class BatSolver
private Map<Integer, Integer> numberOfSolutionsWithPoison; private Map<Integer, Integer> numberOfSolutionsWithPoison;
private final SolutionSet solution; private final SolutionSet solution;
private final HashSet<Integer> grubsChests; private final Set<Integer> grubsChests;
public BatSolver(final ThievingRoomType roomType) public BatSolver(final ThievingRoomType roomType)
{ {
@@ -59,9 +60,9 @@ public class BatSolver
calculateChanceOfPoison(); calculateChanceOfPoison();
} }
public TreeSet<Integer> matchSolutions() public Set<Integer> matchSolutions()
{ {
TreeSet<Integer> possibleEmptyChests = new TreeSet<>(); Set<Integer> possibleEmptyChests = new TreeSet<>();
for (SolutionSet knownSolution : SolutionSet.SOLUTION_SETS) for (SolutionSet knownSolution : SolutionSet.SOLUTION_SETS)
{ {
if (knownSolution.getType() == solution.getType() && matchSolution(knownSolution)) if (knownSolution.getType() == solution.getType() && matchSolution(knownSolution))

View File

@@ -28,7 +28,7 @@ import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.util.Map; import java.util.Map;
import java.util.TreeSet; import java.util.Set;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
import net.runelite.api.Client; import net.runelite.api.Client;
@@ -120,7 +120,7 @@ public class ChestOverlay extends Overlay
BatSolver solver = plugin.getSolver(); BatSolver solver = plugin.getSolver();
if (solver != null && chestId != -1) if (solver != null && chestId != -1)
{ {
TreeSet<Integer> matches = solver.matchSolutions(); Set<Integer> matches = solver.matchSolutions();
return matches.contains(chestId) || matches.size() == 0; return matches.contains(chestId) || matches.size() == 0;
} }
return true; return true;