goterra

package module
v0.0.0-...-cee848a Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 8 Imported by: 0

README

goterra

goterra is a package for Go lang that makes encoding/decoding Legends of Runterra decks easy. This library gets updated according this repository.

Download

  • $ go get github.com/sousa-andre/goterra

Usage

package main

import (
	"fmt"
	"github.com/sousa-andre/goterra"
)

func main() {
	// Import deck
	id := goterra.DeckFromCode("CEBAIAIFB4WDANQIAEAQGDAUDAQSIJZUAIAQCAIEAEAQKBIA")

	for _, cg := range id.CardGroups {
		fmt.Printf("Card Code: %s. Card Count %d\n", cg.Card.GetCardCode(), cg.Count)
	}

	// Create deck
	cd := goterra.NewDeck()
	cd.AddCard("01PZ019", 2)
	cd.AddCard("01IO018", 1)

	fmt.Println("Deck Code: ", cd.Encode())
}

Endorsement

goterra isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factions = map[int]string{
	0:  "DE",
	1:  "FR",
	2:  "IO",
	3:  "NX",
	4:  "PZ",
	5:  "SI",
	6:  "BW",
	9:  "MT",
	7:  "SH",
	10: "BC",
	12: "RU",
}
View Source
var FactionsVersion = map[uint8][2]uint8{
	0:  {1, 1},
	1:  {1, 1},
	2:  {1, 1},
	3:  {1, 1},
	4:  {1, 1},
	5:  {1, 1},
	6:  {1, 2},
	9:  {1, 2},
	7:  {1, 3},
	10: {1, 4},
	12: {1, 5},
}

Functions

This section is empty.

Types

type Card

type Card struct {
	Set     uint8
	Faction uint8
	Id      uint8
}

func CardFromCode

func CardFromCode(cardCode string) *Card

func (Card) GetCardCode

func (c Card) GetCardCode() string

func (Card) GetCardMinFormat

func (c Card) GetCardMinFormat() uint8

func (Card) GetCardMinVersion

func (c Card) GetCardMinVersion() uint8

func (Card) GetFactionStringId

func (c Card) GetFactionStringId() string

type CardGroup

type CardGroup struct {
	Count uint8
	Card  Card
}

type Deck

type Deck struct {
	Format     uint8
	Version    uint8
	CardGroups []CardGroup
}

func DeckFromCode

func DeckFromCode(code string) *Deck

func NewDeck

func NewDeck() *Deck

func (*Deck) AddCard

func (d *Deck) AddCard(cardCode string, cardCount uint8)

func (*Deck) Encode

func (d *Deck) Encode() string

func (*Deck) SortDeck

func (d *Deck) SortDeck()

type Faction

type Faction struct {
	Id     uint8
	TextId string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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