Merge remote-tracking branch 'origin/main'

This commit is contained in:
Speedy Gonzalez 2021-12-10 09:08:44 +01:00
commit 3f625e1e47
2 changed files with 6 additions and 3 deletions

View File

@ -185,6 +185,11 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
return longestRoadFaction;
}
//todo javadoc
public int getLongestRoadLenth() {
return longestRoadLenth;
}
/**
* This method is recursive and adds all roads which belongs to a specific players and stringing together to a HashSet.
* The length of the HashSet represents the length of the longest Road the player has.

View File

@ -37,8 +37,6 @@ public class SiedlerGameTest {
*/
@Test
public void testLongestRoad() {
HashMap<Config.Faction,Integer> currentLongestRoad = new HashMap<>();
//currentLongestRoad.put(Config.Faction.RED,5);
List<Config.Faction> factionList = Arrays.asList(Config.Faction.values());
SiedlerBoard board = new SiedlerBoard();
@ -52,7 +50,7 @@ public class SiedlerGameTest {
board.setEdge(new Point(4, 10), new Point(5, 9), new Road(Config.Faction.BLUE,new Point(4, 10),new Point(5, 9)));
board.setCorner(new Point(3,7),new Settlement(Config.Faction.BLUE,new Point(3,7)));
assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList));
//assertEquals(6,currentLongestRoad.get(Config.Faction.BLUE));
assertEquals(6,board.getLongestRoadLenth());
//todo prüfen ob länge Stimmt.
}