This repository has been archived by the owner on Jan 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CurrentGameParticipant.php
75 lines (67 loc) · 1.92 KB
/
CurrentGameParticipant.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
namespace RiotQuest\Components\Framework\Collections;
use RiotQuest\Components\DataProviders\Provider;
use RiotQuest\Components\Framework\Client\Client;
/**
* Class CurrentGameParticipant
*
* @see https://developer.riotgames.com/api-methods/#spectator-v4/GET_getCurrentGameInfoBySummoner
*
* @property double $profileIconId Summoner Icon ID
* @property double $championId Champion ID which player is playing
* @property string $summonerName Summoner name of player
* @property GameCustomizationObjectList $gameCustomizationObjects Game customization objects
* @property boolean $bot Is player a bot?
* @property Perks $perks Current runes summoner is using
* @property double $spell1Id Spell slot one ID
* @property double $spell2Id Spell slot two ID
* @property double $teamId Team ID for player
* @property string $summonerId Summoner ID of player
*
* @todo spell icons
*
* @package RiotQuest\Components\Framework\Collections
*/
class CurrentGameParticipant extends Collection
{
/**
* Get champion icon
*
* @return string
*/
public function getChampionIcon()
{
return Provider::getChampionSquare($this->championId);
}
/**
* Get summoner object
*
* @return Summoner
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \ReflectionException
* @throws \RiotQuest\Contracts\LeagueException
*/
public function getSummoner()
{
return Client::summoner($this->region)->id($this->summonerId);
}
/**
* Get summoner icon link
*
* @return string
*/
public function getSummonerIcon()
{
return Provider::getProfileIcon($this->profileIconId);
}
/**
* Get champion name by its id
*
* @return string
*/
public function getChampionName()
{
return Provider::getChampionName($this->championId);
}
}