lcu

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package lcu provides a client to work with the LCU API

Index

Constants

View Source
const (
	SummonerSpellIdUrfMark  = 39
	SummonerSpellIdAramMark = 32
)

Summoner spell ids

View Source
const (
	StateNotLaunched = "NotLaunched"
	StateNotInLobby  = "NotInLobby"
	StateInLobby     = "InLobby"
	StateInGame      = "InGame"
)

LCU states

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a LCU client

func TryToGetLCU

func TryToGetLCU() *Client

TryToGetLCU tries to get the LCU instance and returns a LCU client if it succeeds

func (*Client) ApplyItemSet

func (c *Client) ApplyItemSet(itemSet ItemSet)

ApplyItemSet applies the given item set

func (*Client) ApplyRunes

func (c *Client) ApplyRunes(runes RunePage)

ApplyRunes applies the given rune page

func (*Client) ApplySummonerSpells

func (c *Client) ApplySummonerSpells(firstSpellId int, secondSpellId int)

ApplySummonerSpells applies the given summoner spells

func (*Client) CurrentSummoner

func (c *Client) CurrentSummoner() Summoner

CurrentSummoner returns the current logged in summoner

func (*Client) GetAssignedRole

func (c *Client) GetAssignedRole() (string, bool)

GetAssignedRole returns the current assigned role and whether a role was assigned

func (*Client) GetCurrentChampion

func (c *Client) GetCurrentChampion() (int, bool)

GetCurrentChampion returns the current champion id and whether a champion is selected

func (*Client) GetCurrentGameMode

func (c *Client) GetCurrentGameMode() (string, string)

GetCurrentGameMode returns both the LCU game mode name and the formatted game mode name

func (*Client) IsInLobby

func (c *Client) IsInLobby() bool

IsInLobby checks whether the current summoner is in lobby

func (*Client) UpdateState

func (c *Client) UpdateState() string

UpdateState updates the state of the LCU instance and returns current state

type Item

type Item struct {
	Count int    `json:"count"`
	Id    string `json:"id"`
}

Item represents a LoL item

type ItemBlock

type ItemBlock struct {
	Items []Item `json:"items"`
	Type  string `json:"type"`
}

ItemBlock represents a group of items

type ItemSet

type ItemSet struct {
	AssociatedChampions []int       `json:"associatedChampions"`
	AssociatedMaps      []int       `json:"associatedMaps"`
	Blocks              []ItemBlock `json:"blocks"`
	Title               string      `json:"title"`
}

ItemSet represents a set of item blocks associated with a champions and maps

type ItemSets

type ItemSets struct {
	AccountId int64     `json:"accountId"`
	ItemSets  []ItemSet `json:"itemSets"`
	Timestamp int64     `json:"timestamp"`
}

ItemSets represents a group of item sets

type RunePage

type RunePage struct {
	Name            string `json:"name"`
	PrimaryStyleId  int    `json:"primaryStyleId"`
	SubStyleId      int    `json:"subStyleId"`
	SelectedPerkIds []int  `json:"selectedPerkIds"`
	Current         bool   `json:"current"`
}

RunePage represents a LoL rune page

type Summoner

type Summoner struct {
	AccountId     int64  `json:"accountId"`
	Name          string `json:"displayName"`
	ProfileIconId int    `json:"profileIconId"`
	SummonerId    int64  `json:"summonerId"`
}

Summoner represents a summoner

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL