use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class StaticTest method testSummonerSpellList.
@Test
public void testSummonerSpellList() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
Map<Integer, StaticSummonerSpell> list = api.getSummonerSpells();
}
use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class StaticTest method testPerk.
@Test
public void testPerk() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
Map<Integer, StaticPerk> paths = api.getPerks();
System.out.println();
}
use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class UseageTest method testUseage.
@Test
public void testUseage() {
R4J api = new R4J(SecretFile.CREDS);
DataCall.setCacheProvider(new FileSystemCacheProvider());
Map<Integer, StaticRune> runeData = api.getDDragonAPI().getRunes();
Map<Integer, StaticMastery> masteriesData = api.getDDragonAPI().getMasteries();
Map<Integer, StaticChampion> championData = api.getDDragonAPI().getChampions();
Map<Integer, StaticPerk> perkData = api.getDDragonAPI().getPerks();
Summoner summoner = Summoner.byName(LeagueShard.EUW1, "stelar7");
List<String> some = summoner.getLeagueGames().get();
LOLMatch match = LOLMatch.get(summoner.getPlatform(), some.get(0));
MatchParticipant self = match.getParticipants().stream().filter(p -> p.getPuuid().equals(summoner.getPUUID())).findFirst().get();
StaticChampion champion = championData.get(self.getChampionId());
ChampionMastery mastery = summoner.getChampionMastery(champion.getId());
boolean didWin = self.didWin();
System.out.format("Player '%s' played their latest game as '%s'%n", summoner.getName(), champion.getName());
System.out.format("They have a masteryscore of %s on that champion%n", mastery.getChampionPoints());
System.out.format("They played in %s, their role was: %s%n", self.getChampionSelectLane(), self.getRole());
System.out.format("They %s that game%n", didWin ? "won" : "lost");
System.out.format("%nThey used the following perks:%n");
List<PerkSelection> perks = self.getPerks().getPerkStyles().stream().flatMap(s -> s.getSelections().stream()).collect(Collectors.toList());
for (PerkSelection perk : perks) {
StaticPerk perkInfo = perkData.get(perk.getPerk());
String name = perkInfo.getName();
System.out.format("Name: '%-20s' variables: %-5s, %-5s, %-5s%n", name, perk.getVar1(), perk.getVar2(), perk.getVar3());
}
}
use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class MatchListV5Test method testMatchListParams.
@Test
@Disabled
public void testMatchListParams() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
Summoner sum = Summoner.byName(LeagueShard.EUW1, "rufen03");
MatchListBuilder builder = new MatchListBuilder();
builder = builder.withPuuid(sum.getPUUID()).withPlatform(LeagueShard.EUW1);
List<String> strings1 = builder.withCount(100).get();
List<String> strings = builder.withQueue(GameQueueType.TEAM_BUILDER_RANKED_SOLO).get();
List<String> strings2 = builder.withType(MatchlistMatchType.RANKED).get();
System.out.println();
}
use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class TestVALMatch method getList.
@Test
public void getList() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
DataCall.getCacheProvider().clear(URLEndpoint.V1_VAL_MATCHLIST_BY_PUUID, new HashMap<>());
R4J api = new R4J(SecretFile.CREDS);
VALMatchAPI matchAPI = api.getVALAPI().getMatchAPI();
RiotAccount account = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "stl7");
List<MatchReference> matchlist = matchAPI.getMatchList(ValorantShard.EU, account.getPUUID());
System.out.println(matchlist);
}
Aggregations