Search in sources :

Example 26 with SummonerBuilder

use of no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder in project L4J8 by stelar7.

the class SummonerTest method testById.

@Test
public void testById() {
    /*
        Summoner ids have been removed from the spectator endpoint, so this test wont work anymore...
        
        String   id = new SpectatorBuilder().withPlatform(Platform.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerId();
        Summoner s  = new SummonerBuilder().withPlatform(Platform.EUW1).withSummonerId(id).get();
         */
    String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
    Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
    doAssertions.accept(s);
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 27 with SummonerBuilder

use of no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder in project L4J8 by stelar7.

the class ChampionMasteryTest method testChampionMasteryAll.

@Test
public void testChampionMasteryAll() {
    String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
    Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
    List<ChampionMastery> all = new ChampionMasteryBuilder().withPlatform(s.getPlatform()).withSummonerId(s.getSummonerId()).getChampionMasteries();
    assert all != null;
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) ChampionMasteryBuilder(no.stelar7.api.r4j.impl.lol.builders.championmastery.ChampionMasteryBuilder) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) ChampionMastery(no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 28 with SummonerBuilder

use of no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder in project L4J8 by stelar7.

the class ChampionMasteryTest method testChampionMasteryTop.

@Test
public void testChampionMasteryTop() {
    String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
    Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
    List<ChampionMastery> all = new ChampionMasteryBuilder().withPlatform(s.getPlatform()).withSummonerId(s.getSummonerId()).getTopChampions(null);
    assert all != null;
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) ChampionMasteryBuilder(no.stelar7.api.r4j.impl.lol.builders.championmastery.ChampionMasteryBuilder) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) ChampionMastery(no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 29 with SummonerBuilder

use of no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder in project L4J8 by stelar7.

the class ChampionMasteryTest method testChampionMastery.

@Test
public void testChampionMastery() {
    String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
    Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
    ChampionMastery mastery;
    ChampionMasteryBuilder bu = new ChampionMasteryBuilder().withPlatform(s.getPlatform()).withSummonerId(s.getSummonerId());
    mastery = bu.withChampionId(1).getChampionMastery();
    assert mastery != null;
    mastery = bu.withChampionId(2).getChampionMastery();
    assert mastery != null;
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) ChampionMasteryBuilder(no.stelar7.api.r4j.impl.lol.builders.championmastery.ChampionMasteryBuilder) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) ChampionMastery(no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 30 with SummonerBuilder

use of no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder in project L4J8 by stelar7.

the class CheckNormalGameForWinTest method testFindSelfInNormalGame.

@Test
@Disabled
public void testFindSelfInNormalGame() {
    Summoner summoner = new SummonerBuilder().withPlatform(LeagueShard.NA1).withName("devitgg").get();
    List<String> refs = new MatchListBuilder().withPlatform(LeagueShard.NA1).withPuuid(summoner.getPUUID()).get();
    for (String current : refs) {
        LOLMatch match = LOLMatch.get(LeagueShard.NA1, current);
        MatchParticipant self = match.getParticipants().stream().filter(p -> p.getPuuid().equals(summoner.getPUUID())).findFirst().get();
        System.out.println("I " + (self.didWin() ? "won!" : "lost :("));
    }
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) MatchListBuilder(no.stelar7.api.r4j.impl.lol.builders.matchv5.match.MatchListBuilder)

Aggregations

SummonerBuilder (no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder)20 Summoner (no.stelar7.api.r4j.pojo.lol.summoner.Summoner)18 SpectatorBuilder (no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)16 SummonerBuilder (no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder)13 Summoner (no.stelar7.api.l4j8.pojo.summoner.Summoner)9 MatchListBuilder (no.stelar7.api.l4j8.impl.builders.match.MatchListBuilder)4 R4J (no.stelar7.api.r4j.impl.R4J)4 ChampionMasteryBuilder (no.stelar7.api.r4j.impl.lol.builders.championmastery.ChampionMasteryBuilder)4 FileSystemCacheProvider (no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)3 L4J8 (no.stelar7.api.l4j8.impl.L4J8)3 MatchListBuilder (no.stelar7.api.r4j.impl.lol.builders.matchv5.match.MatchListBuilder)3 ChampionMastery (no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery)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 java.util (java.util)2 List (java.util.List)2 Predicate (java.util.function.Predicate)2