8000 Champion Skins now contain more detailed data, added Tactical champio… · Petersil1998/Thresh-Java@bb2e1dd · GitHub
[go: up one dir, main page]

Skip to content

Commit bb2e1dd

Browse files
committed
Champion Skins now contain more detailed data, added Tactical champion Info, replaced relative image paths with absolute ones. Added Skin Lines and Rarity
1 parent 82aee0f commit bb2e1dd

File tree

17 files changed

+444
-191
lines changed

17 files changed

+444
-191
lines changed

src/main/java/net/petersil98/thresh/Thresh.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import net.petersil98.stcommons.model.Summoner;
99
import net.petersil98.stcommons.model.league.League;
1010
import net.petersil98.stcommons.model.league.RankEntry;
11-
import net.petersil98.thresh.collection.*;
1211
import net.petersil98.thresh.model.ChampionMasteries;
1312
import net.petersil98.thresh.model.LoLRanked;
1413
import net.petersil98.thresh.model.PlayerRanks;
@@ -47,17 +46,8 @@ public static void main(String[] args) {
4746
League challengers = LoLRanked.getChallengerLeague(RankedQueue.SOLO_DUO, LeaguePlatform.EUW);
4847
List<RankEntry> leagueEntries = LoLRanked.getRankEntries(RankedDivision.I, RankedTier.BRONZE, RankedQueue.FLEX, LeaguePlatform.EUW);
4948
MatchDetails details = MatchDetails.getMatchDetails("EUW1_987654321", LeagueRegion.EUROPE);
50-
System.out.println(Util.getChallengeIconURL(Challenges.getChallenges().stream().filter(challenge -> !challenge.getLevelToIconPath().isEmpty()).findAny().get(), RankedTier.BRONZE));
5149
ActiveGame game = ActiveGame.ofSummoner(Summoner.getSummonerByName("prinzessin", LeaguePlatform.EUW).getId(), LeaguePlatform.EUW);
5250
System.out.println(game.getSpectatorCommandWindows("C:\\"));
5351
System.out.println(Util.getProfileIconURL(me.getProfileIcon()));
54-
System.out.println(Util.getChampionIconURL(Champions.getChampionByName("Thresh")));
55-
System.out.println(Util.getRuneIconURL(RuneStyles.getRuneStyles().get(2)));
56-
System.out.println(Util.getRuneIconURL(RuneStats.getRuneStats().get(1)));
57-
System.out.println(RuneStyles.getRuneStyles());
58-
System.out.println(Runes.getRunes());
59-
System.out.println(RuneStats.getRuneStats());
60-
Items.getItem(1001).getInto().forEach(System.out::println);
61-
System.out.println(SummonerSpells.getSummonerSpell(14));
6252
}
6353
}

src/main/java/net/petersil98/thresh/collection/Champions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static Champion getChampion(int id){
1616

1717
public static Champion getChampionByName(String name){
1818
String finalName = name.replaceAll("[^A-Za-z]","");
19-
return getChampions().stream().filter(champion -> champion.getName().replaceAll("[^A-Za-z]","").equals(finalName)).findFirst().orElse(null);
19+
return getChampions().stream().filter(champion -> champion.getName().equals(finalName) || champion.getApiName().equals(finalName)).findFirst().orElse(null);
2020
}
2121

2222
public static List<Champion> getChampions() {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package net.petersil98.thresh.collection;
2+
3+
import net.petersil98.thresh.data.SkinLine;
4+
5+
import java.util.ArrayList;
6+
import java.util.List;
7+
import java.util.Map;
8+
9+
public class SkinLines {
10+
11+
private static Map<Integer, SkinLine> skinLines;
12+
13+
public static SkinLine getSkinLine(int id){
14+
return skinLines.get(id);
15+
}
16+
17+
public static List<SkinLine> getSkinLines() {
18+
return new ArrayList<>(skinLines.values());
19+
}
20+
}

src/main/java/net/petersil98/thresh/data/ArenaAugment.java

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
package net.petersil98.thresh.data;
22

3-
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4-
import com.fasterxml.jackson.annotation.JsonProperty;
3+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
4+
import net.petersil98.thresh.model.Deserializers;
55

66
import java.util.Map;
77
import java.util.Objects;
88

9-
@JsonIgnoreProperties(ignoreUnknown = true)
9+
@JsonDeserialize(using = Deserializers.ArenaAugmentDeserializer.class)
1010
public class ArenaAugment {
1111

12-
private int id;
13-
private String name;
14-
private int rarity;
15-
private String tooltip;
16-
@JsonProperty("desc")
17-
private String description;
18-
private String iconLarge;
19-
private String iconSmall;
20-
private Map<String, Double> dataValues;
12+
private final int id;
13+
private final String name;
14+
private final int rarity;
15+
private final String tooltip;
16+
private final String description;
17+
private final String iconLarge;
18+
private final String iconSmall;
19+
private final Map<String, Double> dataValues;
20+
21+
public ArenaAugment(int id, String name, int rarity, String tooltip, String description, String iconLarge, String iconSmall, Map<String, Double> dataValues) {
22+
this.id = id;
23+
this.name = name;
24+
this.rarity = rarity;
25+
this.tooltip = tooltip;
26+
this.description = description;
27+
this.iconLarge = iconLarge;
28+
this.iconSmall = iconSmall;
29+
this.dataValues = dataValues;
30+
}
2131

2232
public int getId() {
2333
return id;

src/main/java/net/petersil98/thresh/data/Challenge.java

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
11
package net.petersil98.thresh.data;
22

3+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
34
import net.petersil98.stcommons.constants.RankedTier;
5+
import net.petersil98.thresh.model.Deserializers;
46

57
import java.util.List;
68
import java.util.Map;
79
import java.util.Objects;
810

11+
@JsonDeserialize(using = Deserializers.ChallengeDeserializer.class)
912
public class Challenge {
1013

11-
private int id;
12-
private String name;
13-
private String description;
14-
private String shortDescription;
15-
private boolean hasLeaderboard;
16-
private Map<RankedTier, String> levelToIconPath;
17-
private Map<RankedTier, Threshold> thresholds;
14+
private final int id;
15+
private final String name;
16+
private final String description;
17+
private final String shortDescription;
18+
private final boolean hasLeaderboard;
19+
private final Map<RankedTier, String> levelToIconPath;
20+
private final Map<RankedTier, Threshold> thresholds;
21+
22+
public Challenge(int id, String name, String description, String shortDescription, boolean hasLeaderboard, Map<RankedTier, String> levelToIconPath, Map<RankedTier, Threshold> thresholds) {
23+
this.id = id;
24+
this.name = name;
25+
this.description = description;
26+
this.shortDescription = shortDescription;
27+
this.hasLeaderboard = hasLeaderboard;
28+
this.levelToIconPath = levelToIconPath;
29+
this.thresholds = thresholds;
30+
}
1831

1932
public int getId() {
2033
return id;
@@ -44,17 +57,10 @@ public Map<RankedTier, Threshold> getThresholds() {
4457
return thresholds;
4558
}
4659

47-
static class Threshold {
60+
public static class Threshold {
4861
private int value;
4962
private List<Reward> rewards;
5063

51-
public Threshold(int value, List<Reward> rewards) {
52-
this.value = value;
53-
this.rewards = rewards;
54-
}
55-
56-
public Threshold() {}
57-
5864
public int getValue() {
5965
return value;
6066
}
@@ -64,18 +70,10 @@ public List<Reward> getRewards() {
6470
}
6571
}
6672

67-
static class Reward {
73+
public static class Reward {
6874
private String category;
6975
private int quantity;
70-
private String title;
71-
72-
private Reward(String category, int quantity, String title) {
73-
this.category = category;
74-
this.quantity = quantity;
75-
this.title = title;
76-
}
77-
78-
private Reward() {}
76+
private String title;
7977

8078
public String getCategory() {
8179
return category;

src/main/java/net/petersil98/thresh/data/Map.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,35 @@
77
import java.util.Objects;
88

99
@JsonDeserialize(using = Deserializers.MapDeserializer.class)
10-
public record Map(int id, String name, String fullImage, Sprite sprite) {
10+
public class Map {
11+
12+
private final int id;
13+
private final String name;
14+
private final String fullImage;
15+
private final Sprite sprite;
16+
17+
public Map(int id, String name, String fullImage, Sprite sprite) {
18+
this.id = id;
19+
this.name = name;
20+
this.fullImage = fullImage;
21+
this.sprite = sprite;
22+
}
23+
24+
public int getId() {
25+
return id;
26+
}
27+
28+
public String getName() {
29+
return name;
30+
}
31+
32+
public String getFullImage() {
33+
return fullImage;
34+
}
35+
36+
public Sprite getSprite() {
37+
return sprite;
38+
}
1139

1240
@Override
1341
public String toString() {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package net.petersil98.thresh.data;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
5+
public enum Rarity {
6+
7+
@JsonProperty("kUltimate")
8+
ULTIMATE,
9+
@JsonProperty("kMythic")
10+
MYTHIC,
11+
@JsonProperty("kLegendary")
12+
LEGENDARY,
13+
@JsonProperty("kEpic")
14+
EPIC,
15+
@JsonProperty("kRare")
16+
RARE,
17+
@JsonProperty("kNoRarity")
18+
NONE
19+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package net.petersil98.thresh.data;
2+
3+
import java.util.Objects;
4+
5+
public class SkinLine {
6+
7+
private int id;
8+
private String name;
9+
private String description;
10+
11+
public int getId() {
12+
return id;
13+
}
14+
15+
public String getName() {
16+
return name;
17+
}
18+
19+
public String getDescription() {
20+
return description;
21+
}
22+
23+
@Override
24+
public String toString() {
25+
return this.name;
26+
}
27+
28+
@Override
29+
public boolean equals(Object o) {
30+
if (this == o) return true;
31+
if (!(o instanceof SkinLine skinLine)) return false;
32+
return id == skinLine.id;
33+
}
34+
35+
@Override
36+
public int hashCode() {
37+
return Objects.hash(id);
38+
}
39+
}

src/main/java/net/petersil98/thresh/data/champion/Champion.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package net.petersil98.thresh.data.champion;
22

33
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
4-
import net.petersil98.stcommons.data.Sprite;
54
import net.petersil98.thresh.model.Deserializers;
65

76
import java.util.List;
@@ -11,39 +10,43 @@
1110
public class Champion {
1211

1312
private final int id;
13+
private final String apiName;
1414
private final String name;
1515
private final String title;
16-
private final String fullImage;
17-
private final Sprite sprite;
1816
private final List<Skin> skins;
1917
private final String lore;
2018
private final List<String> allyTips;
2119
private final List<String> enemyTips;
2220
private final List<String> tags;
2321
private final String resourceType;
24-
private final Info info;
22+
private final TacticalInfo tacticalInfo;
23+
private final PlayStyleInfo playStyleInfo;
2524
private final Stats baseStats;
2625

27-
public Champion(int id, String name, String title, String fullImage, Sprite sprite, List<Skin> skins, String lore, List<String> allyTips, List<String> enemyTips, List<String> tags, String resourceType, Info info, Stats baseStats) {
26+
public Champion(int id, String apiName, String name, String title, List<Skin> skins, String lore, List<String> allyTips, List<String> enemyTips, List<String> tags, String resourceType, TacticalInfo tacticalInfo, PlayStyleInfo playStyleInfo, Stats baseStats) {
2827
this.id = id;
28+
this.apiName = apiName;
2929
this.name = name;
3030
this.title = title;
31-
this.fullImage = fullImage;
32-
this.sprite = sprite;
3331
this.skins = skins;
3432
this.lore = lore;
3533
this.allyTips = allyTips;
3634
this.enemyTips = enemyTips;
3735
this.tags = tags;
3836
this.resourceType = resourceType;
39-
this.info = info;
37+
this.tacticalInfo = tacticalInfo;
38+
this.playStyleInfo = playStyleInfo;
4039
this.baseStats = baseStats;
4140
}
4241

4342
public int getId() {
4443
return id;
4544
}
4645

46+
public String getApiName() {
47+
return apiName;
48+
}
49+
4750
public String getName() {
4851
return name;
4952
}
@@ -52,14 +55,6 @@ public String getTitle() {
5255
return title;
5356
}
5457

55-
public String getFullImage() {
56-
return fullImage;
57-
}
58-
59-
public Sprite getSprite() {
60-
return sprite;
61-
}
62-
6358
public List<Skin> getSkins() {
6459
return skins;
6560
}
@@ -84,8 +79,12 @@ public String getResourceType() {
8479
return resourceType;
8580
}
8681

87-
public Info getInfo() {
88-
return info;
82+
public TacticalInfo getTacticalInfo() {
83+
return tacticalInfo;
84+
}
85+
86+
public PlayStyleInfo getPlayStyleInfo() {
87+
return playStyleInfo;
8988
}
9089

9190
public Stats getBaseStats() {

0 commit comments

Comments
 (0)
0