Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.7 Release #11

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
<!-- region Project configuration -->
<groupId>org.white_sdev.white_gaming.lol</groupId>
<artifactId>league-of-legends-role-identification</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>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</description>
<!--endregion-->

<properties>
<!-- region Configure Java version & Main full package and class name -->
<!-- region Configures Java version & Main full package and class name -->
<!-- WARNING: add release scope if 1.9 and older versions are used at build/plugins/plugin/[maven-compiler-plugin]/configuration-->
<java.version>19</java.version>
<java.version>8</java.version>
<!--endregion-->
<!-- region General configurations of the project -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<!-- In case the compiling device doesn't have docker installed you can create the docker img with Jib -->
<!-- In case the compiling device doesn't have Docker installed, you can create the docker img with Jib -->
<!-- <jkube.build.strategy>jib</jkube.build.strategy>-->
<!-- endregion General configurations of the project -->
<junit.jupiter.version>5.9.2</junit.jupiter.version>
Expand All @@ -46,7 +46,7 @@

<!-- region Sl4fj Provider -->
<!-- https://www.slf4j.org/codes.html#noProviders -->
<!-- This is the one Spring uses -->
<!-- This is the one that Spring uses -->
<!-- https://logback.qos.ch/manual/layouts.html -->
<!-- this will allow you to use logback-test.xml file -->
<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
Expand All @@ -65,7 +65,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
<!-- endregion Lombok (Annotations) Configuration-->
Expand Down Expand Up @@ -130,7 +130,7 @@
<source>${java.version}</source>
<target>${java.version}</target>
<!-- WARNING: add release property for 1.9 and older versions -->
<release>${java.version}</release>
<!-- <release>${java.version}</release>-->
</configuration>
</plugin>
<!-- endregion -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,14 @@ private static Set<ChampionRole<String, String>> getStringChampionRoles(){
}

public static Map<String, String> identifyStringRoles(Set<String> champions){
var roles = new LinkedHashSet<String>(){{
Set<String> roles = new LinkedHashSet<String>(){{
add("Top");
add("Middle");
add("Jungle");
add("Bottom");
add("Utility");
}};
var championRoles = getStringChampionRoles();
Set<ChampionRole<String, String>> championRoles = getStringChampionRoles();
return new RoleIdentifier<>(roles, championRoles).identifyRoles(champions);
}

Expand All @@ -296,7 +296,7 @@ public Map<Champion, Role> identifyRoles(Set<Champion> 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<Champion> championsWithPrimary = getChampionsWithPrimaryRole(role, unassignedChampions, primaryChampionsRole);
Expand All @@ -322,7 +322,7 @@ public Map<Champion, Role> identifyRoles(Set<Champion> 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);
Expand All @@ -336,7 +336,7 @@ public Map<Champion, Role> identifyRoles(Set<Champion> 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);
Expand Down Expand Up @@ -375,7 +375,7 @@ private Optional<Champion> only1ChampionHasThisRoleAndTheRestHaveMoreRoles(List<
.collect(Collectors.toSet());
log.debug("{}unassignedChampionsWithUnassignedRoles:{}", logID, unassignedChampionsWithUnassignedRoles);
Champion singleRoleChampion = null;
for(var championRoleEntity: unassignedChampionsWithUnassignedRoles){
for(ChampionRole<Champion, Role> championRoleEntity: unassignedChampionsWithUnassignedRoles){
log.debug("{}Checking championRoleEntity:{}", logID, championRoleEntity);
Set<ChampionRole<Champion, Role>> thisChampionRoles = unassignedChampionsWithUnassignedRoles.stream().filter(cr->Objects.equals(cr,championRoleEntity)).collect(Collectors.toSet());
log.debug("{}thisChampionRoles:{}", logID, thisChampionRoles);
Expand All @@ -394,7 +394,7 @@ public Champion getHighestWinRateForRole(Set<Champion> champions, Role role) {
log.trace("{}Start ", logID);
Set<ChampionRole<Champion, Role>> 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;
}
Expand Down
Loading