Search in sources :

Example 51 with FileSystemCacheProvider

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();
}
Also used : FileSystemCacheProvider(no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider) MapDetails(no.stelar7.api.r4j.pojo.lol.staticdata.map.MapDetails)

Example 52 with FileSystemCacheProvider

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);
}
Also used : FileSystemCacheProvider(no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider)

Example 53 with FileSystemCacheProvider

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();
}
Also used : FileSystemCacheProvider(no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider)

Example 54 with FileSystemCacheProvider

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();
}
Also used : FileSystemCacheProvider(no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider)

Example 55 with FileSystemCacheProvider

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));
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) FileSystemCacheProvider(no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider) JsonWriter(com.google.gson.stream.JsonWriter) JsonParser(com.google.gson.JsonParser)

Aggregations

FileSystemCacheProvider (no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)28 FileSystemCacheProvider (no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider)27 StaticMastery (no.stelar7.api.l4j8.pojo.staticdata.mastery.StaticMastery)5 Summoner (no.stelar7.api.r4j.pojo.lol.summoner.Summoner)5 SummonerBuilder (no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder)4 StaticChampion (no.stelar7.api.l4j8.pojo.staticdata.champion.StaticChampion)4 java.util (java.util)3 StaticRune (no.stelar7.api.l4j8.pojo.staticdata.rune.StaticRune)3 Summoner (no.stelar7.api.l4j8.pojo.summoner.Summoner)3 R4J (no.stelar7.api.r4j.impl.R4J)3 Item (no.stelar7.api.r4j.pojo.lol.staticdata.item.Item)3 StaticMastery (no.stelar7.api.r4j.pojo.lol.staticdata.mastery.StaticMastery)3 StaticRune (no.stelar7.api.r4j.pojo.lol.staticdata.rune.StaticRune)3 java.awt (java.awt)2 AffineTransform (java.awt.geom.AffineTransform)2 java.awt.image (java.awt.image)2 java.io (java.io)2 URL (java.net.URL)2 List (java.util.List)2 Predicate (java.util.function.Predicate)2