removed warning in SiedlerBoard

This commit is contained in:
Andrin Fassbind 2021-12-10 09:50:23 +01:00
parent 57bdf372f1
commit 8e307e0617
1 changed files with 4 additions and 4 deletions

View File

@ -206,7 +206,7 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
position = getNextPoint(roadsList.get(0), position);
roads = countRoad(faction, position, roads, false);
} else if (roadsList.size() == 2) {
ArrayList<HashSet> possibleRoads = checkRoadsSwitch(faction,2,roadsList,position);
ArrayList<HashSet<Road>> possibleRoads = checkRoadsSwitch(faction,2,roadsList,position);
if (add) {
possibleRoads.get(1).addAll(possibleRoads.get(0));
roads.addAll(possibleRoads.get(1));
@ -221,7 +221,7 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
}
} else if (roadsList.size() == 3) {
ArrayList<HashSet> possibleRoads = checkRoadsSwitch(faction,3,roadsList,position);
ArrayList<HashSet<Road>> possibleRoads = checkRoadsSwitch(faction,3,roadsList,position);
HashSet<Road> tallest;
HashSet<Road> secondTallest;
if (possibleRoads.get(0).size() >= possibleRoads.get(1).size()) {
@ -266,8 +266,8 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
* @param position the current corner from where to count further.
* @return ArrayList of HashSet with all possible forks.
*/
private ArrayList<HashSet> checkRoadsSwitch(Config.Faction faction,int numberOfSwitches,List<Road> roadsList,Point position) {
ArrayList<HashSet> possibleRoads = new ArrayList<>();
private ArrayList<HashSet<Road>> checkRoadsSwitch(Config.Faction faction,int numberOfSwitches,List<Road> roadsList,Point position) {
ArrayList<HashSet<Road>> possibleRoads = new ArrayList<>();
for (int i = 0;i<numberOfSwitches;i++) {
HashSet<Road> list = new HashSet<>();
list.add(roadsList.get(i));