wish

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RegisterExporter

func RegisterExporter(ext string, e Exporter)

func RegisterImporter

func RegisterImporter(ext string, i Importer)

Types

type CSVExporter

type CSVExporter struct{}

func (CSVExporter) Export

func (e CSVExporter) Export(items Items, filename string) error

type Exporter

type Exporter interface {
	Export(items Items, filename string) error
}

type Importer

type Importer interface {
	Import(filename string) (Items, error)
}

type Item

type Item struct {
	*RawItem
	// contains filtered or unexported fields
}

func (Item) ColoredString

func (item Item) ColoredString() string

func (Item) ID

func (item Item) ID() int64

func (Item) Rarity

func (item Item) Rarity() Rarity

func (Item) String

func (item Item) String() string

func (Item) Time

func (item Item) Time() time.Time

func (Item) WishType

func (item Item) WishType() Type

type Items

type Items []Item

func LoadItems

func LoadItems(filename string) (Items, error)

func LoadItemsIfExits

func LoadItemsIfExits(filename string) (Items, error)

func (Items) Count

func (items Items) Count() int

func (Items) Equal

func (items Items) Equal(items2 Items) bool

func (Items) FilterByRarity

func (items Items) FilterByRarity(rarities ...Rarity) Items

func (Items) FilterByUID

func (items Items) FilterByUID(uid string) Items

func (Items) FilterByUIDAndWishType

func (items Items) FilterByUIDAndWishType(uid string, wishTypes ...Type) Items

func (Items) FilterByWishType

func (items Items) FilterByWishType(wishTypes ...Type) Items

func (Items) Len

func (items Items) Len() int

func (Items) Less

func (items Items) Less(i, j int) bool

func (Items) Save

func (items Items) Save(filename string) error

func (Items) Swap

func (items Items) Swap(i, j int)

func (Items) ToCSVRecords

func (items Items) ToCSVRecords() [][]string

func (Items) Unique

func (items Items) Unique() Items

type JSONExporter

type JSONExporter struct{}

func (JSONExporter) Export

func (e JSONExporter) Export(items Items, filename string) error

type JSONImporter

type JSONImporter struct{}

func (JSONImporter) Import

func (i JSONImporter) Import(filename string) (Items, error)

type Rarity

type Rarity int
const (
	OneStar Rarity = iota + 1
	TwoStar
	ThreeStar
	FourStar
	FiveStar
)

func (Rarity) String

func (r Rarity) String() string

type RawItem

type RawItem struct {
	UID      string `json:"uid" toml:"uid" csv:"UID"`
	WishType string `json:"gacha_type" toml:"gacha_type" csv:"Wish Type"`
	ItemID   string `json:"item_id" toml:"item_id" csv:"Item ID"`
	Count    string `json:"count" toml:"count" csv:"Count"`
	Time     string `json:"time" toml:"time" csv:"Time"`
	Name     string `json:"name" toml:"name" csv:"Name"`
	Lang     string `json:"lang" toml:"lang" csv:"Language"`
	ItemType string `json:"item_type" toml:"item_type" csv:"Item Type"`
	Rarity   string `json:"rank_type" toml:"rank_type" csv:"Rarity"`
	ID       string `json:"id" toml:"id" csv:"ID"`
}

func (*RawItem) ToCSVHeader

func (r *RawItem) ToCSVHeader() []string

func (*RawItem) ToCSVRecord

func (r *RawItem) ToCSVRecord() []string

type TOMLExporter

type TOMLExporter struct{}

func (TOMLExporter) Export

func (e TOMLExporter) Export(items Items, filename string) error

type TOMLImporter

type TOMLImporter struct{}

func (TOMLImporter) Import

func (i TOMLImporter) Import(filename string) (Items, error)

type Type

type Type int
const (
	BeginnersWish       Type = 100 // Beginners' Wish (Novice Wish)
	StandardWish        Type = 200 // Standard Wish (Permanent Wish)
	CharacterEventWish  Type = 301 // Character Event Wish
	WeaponEventWish     Type = 302 // Weapon Event Wish
	CharacterEventWish2 Type = 400 // Character Event Wish-2
)

func (Type) GetSharedWishName

func (t Type) GetSharedWishName() string

func (Type) String

func (t Type) String() string

type XLSXExporter

type XLSXExporter struct{}

func (XLSXExporter) Export

func (e XLSXExporter) Export(items Items, filename string) error

Jump to

Keyboard shortcuts

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