Skip to content

Commit

Permalink
spectator-tft, sorting properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyagara committed Mar 18, 2024
1 parent f1b8296 commit e4028a4
Show file tree
Hide file tree
Showing 22 changed files with 491 additions and 41 deletions.
2 changes: 1 addition & 1 deletion api/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package api
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

// Regional routes, used in tournament services, Legends of Runeterra (LoR), and some other endpoints.
type RegionalRoute string
Expand Down
2 changes: 1 addition & 1 deletion clients/lol/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ package lol
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

import "github.com/Kyagara/equinox/internal"

Expand Down
2 changes: 1 addition & 1 deletion clients/lol/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lol
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

// LoL and TFT ranked tiers, such as gold, diamond, challenger, etc.
type Tier string
Expand Down
2 changes: 1 addition & 1 deletion clients/lol/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lol
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

import (
"context"
Expand Down
16 changes: 10 additions & 6 deletions clients/lol/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lol
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

// lol-challenges-v1.ApexPlayerInfoDto
type ChallengesApexPlayerInfoV1DTO struct {
Expand Down Expand Up @@ -655,7 +655,7 @@ type MatchTimelineInfoFrameEventV5DTO struct {
TransformType string `json:"transformType,omitempty"`
// Timeline event type.
//
// (Known legal values: ASCENDED_EVENT, BUILDING_KILL, CAPTURE_POINT, CHAMPION_KILL, CHAMPION_SPECIAL_KILL, CHAMPION_TRANSFORM, DRAGON_SOUL_GIVEN, ELITE_MONSTER_KILL, GAME_END, ITEM_DESTROYED, ITEM_PURCHASED, ITEM_SOLD, ITEM_UNDO, LEVEL_UP, PAUSE_END, PAUSE_START, SKILL_LEVEL_UP, TURRET_PLATE_DESTROYED, WARD_KILL, WARD_PLACED)
// (Known legal values: ASCENDED_EVENT, BUILDING_KILL, CAPTURE_POINT, CHAMPION_KILL, CHAMPION_SPECIAL_KILL, CHAMPION_TRANSFORM, DRAGON_SOUL_GIVEN, ELITE_MONSTER_KILL, GAME_END, ITEM_DESTROYED, ITEM_PURCHASED, ITEM_SOLD, ITEM_UNDO, LEVEL_UP, OBJECTIVE_BOUNTY_PRESTART, PAUSE_END, PAUSE_START, SKILL_LEVEL_UP, TURRET_PLATE_DESTROYED, WARD_KILL, WARD_PLACED)
Type string `json:"type,omitempty"`
WardType string `json:"wardType,omitempty"`
AssistingParticipantIDs []int32 `json:"assistingParticipantIds,omitempty"`
Expand Down Expand Up @@ -892,7 +892,8 @@ type SpectatorCurrentGameInfoV5DTO struct {
// spectator-v4.CurrentGameParticipant
type SpectatorCurrentGameParticipantV4DTO struct {
// The encrypted puuid of this participant
PUUID string `json:"puuid,omitempty"`
PUUID string `json:"puuid,omitempty"`
RiotID string `json:"riotId,omitempty"`
// The encrypted summoner ID of this participant
SummonerID string `json:"summonerId,omitempty"`
// The summoner name of this participant
Expand All @@ -918,7 +919,8 @@ type SpectatorCurrentGameParticipantV4DTO struct {
// spectator-v5.CurrentGameParticipant
type SpectatorCurrentGameParticipantV5DTO struct {
// The encrypted puuid of this participant
PUUID string `json:"puuid,omitempty"`
PUUID string `json:"puuid,omitempty"`
RiotID string `json:"riotId,omitempty"`
// The encrypted summoner ID of this participant
SummonerID string `json:"summonerId,omitempty"`
// The summoner name of this participant
Expand Down Expand Up @@ -1044,7 +1046,8 @@ type SpectatorObserverV5DTO struct {
// spectator-v4.Participant
type SpectatorParticipantV4DTO struct {
// Encrypted puuid of this participant
PUUID string `json:"puuid,omitempty"`
PUUID string `json:"puuid,omitempty"`
RiotID string `json:"riotId,omitempty"`
// Encrypted summoner ID of this participant
SummonerID string `json:"summonerId,omitempty"`
// The summoner name of this participant
Expand All @@ -1066,7 +1069,8 @@ type SpectatorParticipantV4DTO struct {
// spectator-v5.Participant
type SpectatorParticipantV5DTO struct {
// Encrypted puuid of this participant
PUUID string `json:"puuid,omitempty"`
PUUID string `json:"puuid,omitempty"`
RiotID string `json:"riotId,omitempty"`
// Encrypted summoner ID of this participant
SummonerID string `json:"summonerId,omitempty"`
// The summoner name of this participant
Expand Down
2 changes: 1 addition & 1 deletion clients/lor/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package lor
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

import "github.com/Kyagara/equinox/internal"

Expand Down
2 changes: 1 addition & 1 deletion clients/lor/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lor
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion clients/lor/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lor
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

// lor-deck-v1.NewDeckDto
type DeckNewDeckV1DTO struct {
Expand Down
2 changes: 1 addition & 1 deletion clients/riot/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package riot
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

import "github.com/Kyagara/equinox/internal"

Expand Down
2 changes: 1 addition & 1 deletion clients/riot/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package riot
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion clients/riot/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package riot
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

// account-v1.ActiveShardDto
type AccountActiveShardV1DTO struct {
Expand Down
21 changes: 12 additions & 9 deletions clients/tft/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This package is used to interact with all TFT endpoints.
// - SpectatorV5
// - LeagueV1
// - MatchV1
// - StatusV1
Expand All @@ -15,23 +16,25 @@ package tft
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

import "github.com/Kyagara/equinox/internal"

type Client struct {
LeagueV1 LeagueV1
MatchV1 MatchV1
StatusV1 StatusV1
SummonerV1 SummonerV1
SpectatorV5 SpectatorV5
LeagueV1 LeagueV1
MatchV1 MatchV1
StatusV1 StatusV1
SummonerV1 SummonerV1
}

// Creates a new TFT Client using the internal.Client provided.
func NewTFTClient(client *internal.Client) *Client {
return &Client{
LeagueV1: LeagueV1{internal: client},
MatchV1: MatchV1{internal: client},
StatusV1: StatusV1{internal: client},
SummonerV1: SummonerV1{internal: client},
SpectatorV5: SpectatorV5{internal: client},
LeagueV1: LeagueV1{internal: client},
MatchV1: MatchV1{internal: client},
StatusV1: StatusV1{internal: client},
SummonerV1: SummonerV1{internal: client},
}
}
145 changes: 144 additions & 1 deletion clients/tft/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package tft
// //
///////////////////////////////////////////////

// Spec version = 031d3e7fc343bd86d82c45559fc79d3a87fa1b82
// Spec version = 1e85b75ffc0bd58ccaf724557782b1e6b9bd27af

// LoL and TFT ranked tiers, such as gold, diamond, challenger, etc.
type Tier string
Expand Down Expand Up @@ -163,6 +163,149 @@ func (route PlatformRoute) String() string {
}
}

// TFT game type: matched game, custom game, or tutorial game.
type GameType string

const (
// Custom games
CUSTOM_GAME GameType = "CUSTOM_GAME"
// all other games
MATCHED_GAME GameType = "MATCHED_GAME"
// Tutorial games
TUTORIAL_GAME GameType = "TUTORIAL_GAME"
)

func (gameType GameType) String() string {
switch gameType {
case CUSTOM_GAME:
return "CUSTOM_GAME"
case MATCHED_GAME:
return "MATCHED_GAME"
case TUTORIAL_GAME:
return "TUTORIAL_GAME"
default:
return string(gameType)
}
}

// League of Legends game mode, such as Classic,
// ARAM, URF, One For All, Ascension, etc.
type GameMode string

const (
// ARAM games
ARAM GameMode = "ARAM"
// All Random Summoner's Rift games
ARSR GameMode = "ARSR"
// Ascension games
ASCENSION GameMode = "ASCENSION"
// Blood Hunt Assassin games
ASSASSINATE GameMode = "ASSASSINATE"
// 2v2v2v2
CHERRY_GAMEMODE GameMode = "CHERRY_GameMode"
// Classic Summoner's Rift and Twisted Treeline games
CLASSIC GameMode = "CLASSIC"
// Dark Star: Singularity games
DARKSTAR GameMode = "DARKSTAR"
// Doom Bot games
DOOMBOTSTEEMO GameMode = "DOOMBOTSTEEMO"
// Snowdown Showdown games
FIRSTBLOOD GameMode = "FIRSTBLOOD"
// Nexus Blitz games
GAMEMODEX GameMode = "GAMEMODEX"
// Legend of the Poro King games
KINGPORO GameMode = "KINGPORO"
// Nexus Blitz games
NEXUSBLITZ GameMode = "NEXUSBLITZ"
// Dominion/Crystal Scar games
ODIN GameMode = "ODIN"
// Odyssey: Extraction games
ODYSSEY GameMode = "ODYSSEY"
// One for All games
ONEFORALL GameMode = "ONEFORALL"
// Practice tool training games.
PRACTICETOOL GameMode = "PRACTICETOOL"
// PROJECT: Hunters games
PROJECT GameMode = "PROJECT"
// Nexus Siege games
SIEGE GameMode = "SIEGE"
// Star Guardian Invasion games
STARGUARDIAN GameMode = "STARGUARDIAN"
// Teamfight Tactics, used in `spectator-v4` endpoints.
TFT GameMode = "TFT"
// Tutorial games
TUTORIAL GameMode = "TUTORIAL"
// Tutorial: Welcome to League.
TUTORIAL_MODULE_1 GameMode = "TUTORIAL_MODULE_1"
// Tutorial: Power Up.
TUTORIAL_MODULE_2 GameMode = "TUTORIAL_MODULE_2"
// Tutorial: Shop for Gear.
TUTORIAL_MODULE_3 GameMode = "TUTORIAL_MODULE_3"
// Ultimate Spellbook games
ULTBOOK GameMode = "ULTBOOK"
// URF games
URF GameMode = "URF"
)

func (gameMode GameMode) String() string {
switch gameMode {
case ARAM:
return "ARAM"
case ARSR:
return "ARSR"
case ASCENSION:
return "ASCENSION"
case ASSASSINATE:
return "ASSASSINATE"
case CHERRY_GAMEMODE:
return "CHERRY_GameMode"
case CLASSIC:
return "CLASSIC"
case DARKSTAR:
return "DARKSTAR"
case DOOMBOTSTEEMO:
return "DOOMBOTSTEEMO"
case FIRSTBLOOD:
return "FIRSTBLOOD"
case GAMEMODEX:
return "GAMEMODEX"
case KINGPORO:
return "KINGPORO"
case NEXUSBLITZ:
return "NEXUSBLITZ"
case ODIN:
return "ODIN"
case ODYSSEY:
return "ODYSSEY"
case ONEFORALL:
return "ONEFORALL"
case PRACTICETOOL:
return "PRACTICETOOL"
case PROJECT:
return "PROJECT"
case SIEGE:
return "SIEGE"
case STARGUARDIAN:
return "STARGUARDIAN"
case TFT:
return "TFT"
case TUTORIAL:
return "TUTORIAL"
case TUTORIAL_MODULE_1:
return "TUTORIAL_MODULE_1"
case TUTORIAL_MODULE_2:
return "TUTORIAL_MODULE_2"
case TUTORIAL_MODULE_3:
return "TUTORIAL_MODULE_3"
case ULTBOOK:
return "ULTBOOK"
case URF:
return "URF"
default:
return string(gameMode)
}
}

// TFT ranked queue types.
type QueueType string

Expand Down
Loading

0 comments on commit e4028a4

Please sign in to comment.