Search in sources :

Example 6 with MatchListBuilder

use of no.stelar7.api.l4j8.impl.builders.match.MatchListBuilder in project L4J8 by stelar7.

the class MatchListTest method testMatchAndMatchList.

@Test
@Ignore
public void testMatchAndMatchList() {
    DataCall.setCacheProvider(new FileSystemCacheProvider());
    DataCall.setLogLevel(LogLevel.INFO);
    // EnumSet.of(GameQueueType.TEAM_BUILDER_RANKED_SOLO);
    Set<GameQueueType> queue = null;
    // EnumSet.of(SeasonType.SEASON_2018);
    Set<SeasonType> season = null;
    // new HashSet<>(Collections.singletonList(40));
    Set<Integer> champ = null;
    // LocalDateTime.now().withHour(0).toEpochSecond(ZoneOffset.UTC) * 1000;//1481108400000L; // start of season 2017
    Long beginTime = null;
    // LocalDateTime.now().withHour(0).plusWeeks(1).toEpochSecond(ZoneOffset.UTC) * 1000; // 604800000 is one week in ms
    Long endTime = null;
    // 0;
    Long beginIndex = null;
    // 100;
    Long endIndex = null;
    MatchListBuilder builder = new MatchListBuilder();
    Summoner sum = new SummonerBuilder().withPlatform(Platform.EUW1).withName("stelar7").get();
    builder = builder.withPlatform(sum.getPlatform()).withAccountId(sum.getAccountId());
    builder = builder.withBeginTime(beginTime).withEndTime(endTime);
    builder = builder.withBeginIndex(beginIndex).withEndIndex(endIndex);
    builder = builder.withQueues(queue).withSeasons(season).withChampions(champ);
    LazyList<MatchReference> all = builder.getLazy();
    MatchBuilder mb = new MatchBuilder();
    TimelineBuilder tb = new TimelineBuilder();
    for (MatchReference reference : all) {
        Match detail = reference.getFullMatch();
    }
}
Also used : Summoner(no.stelar7.api.l4j8.pojo.summoner.Summoner) SummonerBuilder(no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder) FileSystemCacheProvider(no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)

Example 7 with MatchListBuilder

use of no.stelar7.api.l4j8.impl.builders.match.MatchListBuilder in project L4J8 by stelar7.

the class AsyncTest method testAsync.

@Test
@Ignore
public void testAsync() {
    List<CompletableFuture> futures = new ArrayList<>();
    for (int i = 0; i < 100; i++) {
        futures.add(supplyAsync(() -> new SummonerBuilder().withPlatform(Platform.EUW1).withAccountId(Constants.TEST_ACCOUNT_IDS[1]).get()).thenAccept(this::handleSummonerCallback));
    }
    futures.add(supplyAsync(() -> new MatchListBuilder().withPlatform(Platform.EUW1).withAccountId(Constants.TEST_ACCOUNT_IDS[1]).get()).thenAccept(this::handleMatchCallback));
    CompletableFuture spinner = CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]));
    spinner.join();
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) SummonerBuilder(no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder) MatchListBuilder(no.stelar7.api.l4j8.impl.builders.match.MatchListBuilder)

Aggregations

MatchListBuilder (no.stelar7.api.l4j8.impl.builders.match.MatchListBuilder)5 SummonerBuilder (no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder)5 Summoner (no.stelar7.api.l4j8.pojo.summoner.Summoner)4 FileSystemCacheProvider (no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)3 java.awt (java.awt)1 AffineTransform (java.awt.geom.AffineTransform)1 java.awt.image (java.awt.image)1 java.io (java.io)1 URL (java.net.URL)1 java.util (java.util)1 List (java.util.List)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 Predicate (java.util.function.Predicate)1 IntStream (java.util.stream.IntStream)1 ImageIO (javax.imageio.ImageIO)1 DataCall (no.stelar7.api.l4j8.basic.calling.DataCall)1 Platform (no.stelar7.api.l4j8.basic.constants.api.Platform)1 no.stelar7.api.l4j8.basic.constants.types (no.stelar7.api.l4j8.basic.constants.types)1 no.stelar7.api.l4j8.basic.utils (no.stelar7.api.l4j8.basic.utils)1 L4J8 (no.stelar7.api.l4j8.impl.L4J8)1