From aa11256b0998821d6e409a5c7b80bfe59c6bae87 Mon Sep 17 00:00:00 2001 From: Obed Vazquez Date: Tue, 26 Dec 2023 22:54:09 -0600 Subject: [PATCH] 1.0.7 Release - `README.md` and `pom.xml` were updated with the latest version and are ready for the `release` process. - We are leaving the jitpack.yml file, but we should not require it. --- README.md | 2 +- jitpack.yml | 6 +++--- pom.xml | 14 +++++++------- .../white_gaming/lol/RoleIdentifier.java | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index e233336..c08bbb5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This library will help you to take an educated guess and calculate the rol/posit ## 1) What is this repository for? ### 1.1) Quick summary -Version: `1.0.6` +Version: `1.0.7` This library will help you to take an educated guess and calculate the rol/position/lane in which a champion will or should be in a 5v5 team of a League of Legends match. diff --git a/jitpack.yml b/jitpack.yml index 797f7bc..b706658 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,8 +1,8 @@ jdk: - - openjdk19 + - openjdk21 before_install: - - sdk install java 21.0.1-temurin - - sdk use java 21.0.1-temurin + - sdk install java 21.0.1-tem + - sdk use java 21.0.1-tem - sdk install maven - mvn -v install: diff --git a/pom.xml b/pom.xml index 8548477..1a8dda8 100644 --- a/pom.xml +++ b/pom.xml @@ -7,22 +7,22 @@ org.white_sdev.white_gaming.lol league-of-legends-role-identification - 1.0.6 + 1.0.7 ${project.groupId}:${project.artifactId} This library will help you to take an educated guess and calculate the rol/position/lane in which a champion will or should be in a 5v5 team of a League of Legends match - + - 19 + 8 UTF-8 UTF-8 ${java.version} ${java.version} - + 5.9.2 @@ -46,7 +46,7 @@ - + @@ -65,7 +65,7 @@ org.projectlombok lombok - 1.18.26 + 1.18.30 provided @@ -130,7 +130,7 @@ ${java.version} ${java.version} - ${java.version} + diff --git a/src/main/java/org/white_sdev/white_gaming/lol/RoleIdentifier.java b/src/main/java/org/white_sdev/white_gaming/lol/RoleIdentifier.java index 4efee06..a93825a 100644 --- a/src/main/java/org/white_sdev/white_gaming/lol/RoleIdentifier.java +++ b/src/main/java/org/white_sdev/white_gaming/lol/RoleIdentifier.java @@ -267,14 +267,14 @@ private static Set> getStringChampionRoles(){ } public static Map identifyStringRoles(Set champions){ - var roles = new LinkedHashSet(){{ + Set roles = new LinkedHashSet(){{ add("Top"); add("Middle"); add("Jungle"); add("Bottom"); add("Utility"); }}; - var championRoles = getStringChampionRoles(); + Set> championRoles = getStringChampionRoles(); return new RoleIdentifier<>(roles, championRoles).identifyRoles(champions); } @@ -296,7 +296,7 @@ public Map identifyRoles(Set champions){ boolean iterationAssignedRole = false; log.debug("{}Iteration:{}. unassignedRoles:{}. unassignedChampions:{}{}", logID, i, unassignedRoles, unassignedChampions, lastIterationAssignedRole?"":" FLAGGED TO SOLVE CONFLICTS"); - for (var role : new ArrayList<>(unassignedRoles)) { + for (Role role : new ArrayList<>(unassignedRoles)) { log.debug("{}Role:{}", logID, role); Set championsWithPrimary = getChampionsWithPrimaryRole(role, unassignedChampions, primaryChampionsRole); @@ -322,7 +322,7 @@ public Map identifyRoles(Set champions){ continue; } } - var foundChampion = championsThatCanBeInThatRole.iterator().next(); + Champion foundChampion = championsThatCanBeInThatRole.iterator().next(); log.debug("{}ASSIGNED - foundChampion:{} to role:{}", logID, foundChampion, role); unassignedRoles.remove(role); unassignedChampions.remove(foundChampion); @@ -336,7 +336,7 @@ public Map identifyRoles(Set champions){ Champion foundChampion = championsWithPrimary.size()>1 ? primaryChampionsRole.stream() .filter(pcr->championsWithPrimary.contains(pcr.champion)) .max(Comparator.comparingDouble(ChampionRole::getWinRate)) - .map(cr->cr.champion).orElseThrow() + .map(cr->cr.champion).orElseThrow(()->new NoSuchElementException("No champion found")) :championsWithPrimary.iterator().next(); log.debug("{}ASSIGNED - a primary role on champion:{} to role:{} was found.", logID, foundChampion, role); unassignedRoles.remove(role); @@ -375,7 +375,7 @@ private Optional only1ChampionHasThisRoleAndTheRestHaveMoreRoles(List< .collect(Collectors.toSet()); log.debug("{}unassignedChampionsWithUnassignedRoles:{}", logID, unassignedChampionsWithUnassignedRoles); Champion singleRoleChampion = null; - for(var championRoleEntity: unassignedChampionsWithUnassignedRoles){ + for(ChampionRole championRoleEntity: unassignedChampionsWithUnassignedRoles){ log.debug("{}Checking championRoleEntity:{}", logID, championRoleEntity); Set> thisChampionRoles = unassignedChampionsWithUnassignedRoles.stream().filter(cr->Objects.equals(cr,championRoleEntity)).collect(Collectors.toSet()); log.debug("{}thisChampionRoles:{}", logID, thisChampionRoles); @@ -394,7 +394,7 @@ public Champion getHighestWinRateForRole(Set champions, Role role) { log.trace("{}Start ", logID); Set> filteredChampionRoles = championRoles.stream().filter(cr->champions.contains(cr.champion) && Objects.equals(cr.role, role)).collect(Collectors.toSet()); log.debug("{}Champions to compare:{}", logID, filteredChampionRoles); - var max = filteredChampionRoles.stream().max(Comparator.comparingDouble(ChampionRole::getWinRate)).map(cr->cr.champion).orElseThrow(); + Champion max = filteredChampionRoles.stream().max(Comparator.comparingDouble(ChampionRole::getWinRate)).map(cr->cr.champion).orElseThrow(()->new NoSuchElementException("No champion found")); log.debug("{}Champion with the highest win-rate: {}", logID,max); return max; }