use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class StaticTest method testMaps.
@Test
public void testMaps() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
Map<String, MapDetails> data = api.getMaps();
}
use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class StaticTest method testChampionSingle.
@Test
public void testChampionSingle() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
StaticChampion list = api.getChampion(1);
double r = list.getSpells().get(0).getRange().get(0);
System.out.println(r);
Assertions.assertEquals(list.getId(), 1);
}
use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class StaticTest method testLanguageStrings.
@Test
public void testLanguageStrings() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
Map<String, String> strings = api.getLanguageStrings();
}
use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class StaticTest method testPerkPath.
@Test
public void testPerkPath() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
Map<Integer, PerkPath> paths = api.getPerkPaths();
}
use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.
the class MatchListV5Test method testMatchInvalidSpellSlots.
@Test
@Disabled
public void testMatchInvalidSpellSlots() throws IOException {
DataCall.setCacheProvider(new FileSystemCacheProvider());
MatchListBuilder builder = new MatchListBuilder();
Summoner sum = Summoner.byName(LeagueShard.EUW1, "stelar7");
LazyList<String> all = sum.getLeagueGames().getLazy();
MatchBuilder mb = new MatchBuilder(sum.getPlatform());
TimelineBuilder tb = new TimelineBuilder(sum.getPlatform());
StringWriter sw = new StringWriter();
JsonWriter sb = new JsonWriter(sw);
sb.beginObject();
int i = 0;
for (String matchid : all) {
if (i++ > 10)
break;
tb = tb.withId(matchid);
mb = mb.withId(matchid);
LOLMatch match = mb.getMatch();
LOLTimeline lolTimeline = tb.getTimeline();
List<TimelineDamageData> wierdEntries = new ArrayList<>();
lolTimeline.getFrames().forEach(frame -> {
frame.getEvents().forEach(event -> {
if (event.getType() == EventType.CHAMPION_KILL) {
event.getVictimDamageReceived().forEach(d -> {
if (d.getSpellSlot() == SpellSlotType.INVALID || d.getSpellSlot() == SpellSlotType.UNDOCUMENTED || d.getSpellSlot() == SpellSlotType.UNUSED || d.getSpellSlot() == SpellSlotType.OUT_OF_BOUNDS) {
wierdEntries.add(d);
}
});
event.getVictimDamageDealt().forEach(d -> {
if (d.getSpellSlot() == SpellSlotType.INVALID || d.getSpellSlot() == SpellSlotType.UNDOCUMENTED || d.getSpellSlot() == SpellSlotType.UNUSED || d.getSpellSlot() == SpellSlotType.OUT_OF_BOUNDS) {
wierdEntries.add(d);
}
});
}
});
});
if (wierdEntries.size() > 0) {
sb.name(tb.getID());
sb.beginArray();
for (TimelineDamageData wierdEntry : wierdEntries) {
sb.jsonValue(Utils.getGson().toJson(wierdEntry));
}
sb.endArray();
}
}
sb.endObject();
sb.flush();
String output = Utils.getGson().toJson(new JsonParser().parse(sw.toString()));
Files.write(Paths.get("C:\\Users\\stelar7\\Desktop\\errors.json"), output.getBytes(StandardCharsets.UTF_8));
}
Aggregations