Search in sources :

Example 6 with VALMatchAPI

use of no.stelar7.api.r4j.impl.val.VALMatchAPI in project L4J8 by stelar7.

the class TestVALMatch method getDeep.

@Test
public void getDeep() {
    R4J api = new R4J(SecretFile.CREDS);
    VALMatchAPI matchAPI = api.getVALAPI().getMatchAPI();
    RiotAccount account = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "Jbzz", "EUW");
    List<String> ids = new ArrayList<>();
    ids.add(account.getPUUID());
    List<MatchReference> matchlist = matchAPI.getMatchList(ValorantShard.EU, account.getPUUID());
    matchlist.forEach(m -> {
        VALMatch match = matchAPI.getMatch(ValorantShard.EU, m.getMatchId());
        match.getRoundResults().forEach(r -> {
            if (match.getPlayers().stream().anyMatch(p -> p.getCharacter() == null)) {
                System.out.println();
            }
            r.getPlayerStats().forEach(s -> {
                if (s.getAbility().getGrenadeEffects() != null && !s.getAbility().getGrenadeEffects().equals("null")) {
                    System.out.println();
                }
            });
        });
        match.getPlayers().forEach(p -> ids.add(p.getPUUID()));
    });
    ids.forEach(puuid -> {
        List<MatchReference> matches = matchAPI.getMatchList(ValorantShard.EU, puuid);
        matches.forEach(m -> {
            VALMatch match = matchAPI.getMatch(ValorantShard.EU, m.getMatchId());
            match.getRoundResults().forEach(r -> {
                r.getPlayerStats().forEach(s -> {
                    if (s.getAbility().getGrenadeEffects() != null && !s.getAbility().getGrenadeEffects().equals("null")) {
                        System.out.println();
                    }
                });
            });
        });
    });
}
Also used : RiotAccount(no.stelar7.api.r4j.pojo.shared.RiotAccount) VALMatchAPI(no.stelar7.api.r4j.impl.val.VALMatchAPI) R4J(no.stelar7.api.r4j.impl.R4J)

Aggregations

R4J (no.stelar7.api.r4j.impl.R4J)6 VALMatchAPI (no.stelar7.api.r4j.impl.val.VALMatchAPI)6 RiotAccount (no.stelar7.api.r4j.pojo.shared.RiotAccount)4 FileSystemCacheProvider (no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider)1 URLEndpoint (no.stelar7.api.r4j.basic.constants.api.URLEndpoint)1