models

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var REMOVE_COLOR_CODES_REGEX = regexp.MustCompile(`§[0-9a-fk-orA-FK-OR]`)
View Source
var REMOVE_PERCENTAGE_COLOR_CODES_REGEX = regexp.MustCompile(`%%[^%]+%%`)

Functions

This section is empty.

Types

type BasicItem

type BasicItem struct {
	Id     string `json:"id"`
	Amount int    `json:"amount"`
}

type BasicNetworthItem

type BasicNetworthItem struct {
	ItemId       string       `json:"itemId"`
	Amount       int          `json:"amount"`
	ItemName     string       `json:"itemName"`
	SkyblockItem *HypixelItem `json:"skyblockItem"`

	Prices map[string]float64 `json:"prices"`

	NonCosmetic      bool              `json:"nonCosmetic"`
	Calculation      []CalculationData `json:"calculation"`
	BasePrice        float64           `json:"basePrice"`
	Price            float64           `json:"price"`
	SoulboundPortion float64           `json:"soulboundPortion"`
}

func NewBasicItemNetworthCalculator

func NewBasicItemNetworthCalculator(item *BasicItem, prices map[string]float64, itemProvider ItemProvider) *BasicNetworthItem

func (*BasicNetworthItem) Calculate

func (item *BasicNetworthItem) Calculate()

type CalculationData

type CalculationData struct {
	Id        string  `json:"id"`
	Type      string  `json:"type"`
	Price     float64 `json:"price"`
	Count     int     `json:"count"`
	Soulbound bool    `json:"soulbound,omitempty"`
	Star      int     `json:"star,omitempty"`
}

type CategoryInfo

type CategoryInfo struct {
	Items interface{}
	Type  string // "decoded", "basic", "pets"
}

type DecodedDisplay

type DecodedDisplay struct {
	Name  string   `nbt:"Name" json:"name,omitempty"`
	Lore  []string `nbt:"Lore" json:"lore,omitempty"`
	Color int      `nbt:"color" json:"color,omitempty"`
}

type DecodedInventory

type DecodedInventory struct {
	Items []skycrypttypes.Item `nbt:"i" json:"items,omitempty"`
}

type DecodedNewYearCakeBagData

type DecodedNewYearCakeBagData struct {
	Items []skycrypttypes.Item `nbt:"i" json:"items,omitempty"`
}

type GemstoneCost

type GemstoneCost struct {
	Type   string `json:"type"`
	ItemId string `json:"item_id"`
	Coins  int    `json:"coins"`
	Amount int    `json:"amount"`
}

type GemstoneSlot

type GemstoneSlot struct {
	SlotType string         `json:"slot_type"`
	Costs    []GemstoneCost `json:"costs"`
}

type Handler

type Handler interface {
	Applies(item *NetworthItem) bool
	Calculate(item *NetworthItem, prices map[string]float64)
	IsCosmetic() bool
}

type HypixelItem

type HypixelItem struct {
	Material          string          `json:"material"`
	Skin              skin            `json:"skin,omitempty"`
	Name              string          `json:"name"`
	Category          string          `json:"category"`
	Rarity            string          `json:"tier"`
	SkyBlockID        string          `json:"id,omitempty"`
	Damage            int             `json:"damage,omitempty"`
	Origin            string          `json:"origin,omitempty"`
	RiftTransferrable bool            `json:"rift_transferrable,omitempty"`
	UpgradeCosts      [][]UpgradeCost `json:"upgrade_costs,omitempty"`
	GemstoneSlots     []GemstoneSlot  `json:"gemstone_slots,omitempty"`
	Prestige          PrestigeCost    `json:"prestige,omitempty"`
}

type HypixelItemsResponse

type HypixelItemsResponse struct {
	Success     bool          `json:"success"`
	Cause       string        `json:"cause,omitempty"`
	LastUpdated int64         `json:"lastUpdated"`
	Items       []HypixelItem `json:"items"`
}

type ItemProvider

type ItemProvider interface {
	GetItem(itemId string) *HypixelItem
}

ItemProvider is an interface for getting item data

type Level

type Level struct {
	Level           int     `json:"level"`
	ExperienceToMax int     `json:"xpMax"`
	Experience      float64 `json:"xp"`
}

type NetworthItem

type NetworthItem struct {
	ItemName        string                         `json:"itemName"`
	ExtraAttributes *skycrypttypes.ExtraAttributes `json:"extraAttributes"`
	ItemId          string                         `json:"itemId"`
	SkyblockItem    *HypixelItem                   `json:"skyblockItem"`
	ItemLore        []string                       `json:"itemLore"`
	Count           int                            `json:"count"`
	BaseItemId      string                         `json:"baseItemId"`

	Prices map[string]float64 `json:"prices"`

	NonCosmetic      bool              `json:"nonCosmetic"`
	Calculation      []CalculationData `json:"calculation"`
	BasePrice        float64           `json:"basePrice"`
	Price            float64           `json:"price"`
	SoulboundPortion float64           `json:"soulboundPortion"`
}

func NewSkyBlockItemCaclulator

func NewSkyBlockItemCaclulator(item *skycrypttypes.Item, prices map[string]float64, itemProvider ItemProvider, options NetworthOptions) *NetworthItem

func (*NetworthItem) Calculate

func (item *NetworthItem) Calculate(handlers []Handler)

func (*NetworthItem) GetBasePrice

func (item *NetworthItem) GetBasePrice()

func (*NetworthItem) GetCalculation

func (item *NetworthItem) GetCalculation() []CalculationData

func (*NetworthItem) GetPrice

func (item *NetworthItem) GetPrice() float64

func (*NetworthItem) IsCosmetic

func (item *NetworthItem) IsCosmetic() bool

func (*NetworthItem) IsRecombobulated

func (item *NetworthItem) IsRecombobulated() bool

func (*NetworthItem) IsSoulbound

func (item *NetworthItem) IsSoulbound() bool

type NetworthItemResult

type NetworthItemResult struct {
	Name             string              `json:"name"`
	LoreName         string              `json:"loreName"`
	Id               string              `json:"id"`
	CustomId         string              `json:"customId"`
	Price            float64             `json:"price"`
	SoulboundPortion float64             `json:"soulboundPortion"`
	BasePrice        float64             `json:"basePrice"`
	Calculation      []CalculationData   `json:"calculation"`
	Count            int                 `json:"count"`
	Soulbound        bool                `json:"soulbound"`
	Cosmetic         bool                `json:"cosmetic"`
	ItemData         *skycrypttypes.Item `json:"itemData,omitempty"`
	PetData          *skycrypttypes.Pet  `json:"petData,omitempty"`
}

type NetworthOptions

type NetworthOptions struct {
	Prices           map[string]float64
	NonCosmetic      bool
	CachePrices      bool
	OnlyNetworth     bool
	IncludeItemData  bool
	SortItems        bool
	StackItems       bool
	KeepInvalidItems bool
}

type NetworthPet

type NetworthPet struct {
	PetData skycrypttypes.Pet `json:"petData"`

	NonCosmetic bool   `json:"nonCosmetic"`
	Skin        string `json:"string"`
	BasePetId   string `json:"basePetId"`
	PetId       string `json:"petId"`
	Level       Level  `json:"level"`
	PetName     string `json:"petName"`

	Prices map[string]float64 `json:"prices"`

	Calculation []CalculationData `json:"calculation"`
	BasePrice   float64           `json:"basePrice"`
	Price       float64           `json:"price"`
}

func NewSkyBlockPetCalculator

func NewSkyBlockPetCalculator(item *skycrypttypes.Pet, prices map[string]float64, options NetworthOptions) *NetworthPet

func (*NetworthPet) Calculate

func (item *NetworthPet) Calculate(handlers []PetHandler)

func (*NetworthPet) GetCalculation

func (item *NetworthPet) GetCalculation() []CalculationData

func (*NetworthPet) GetPetId

func (item *NetworthPet) GetPetId() string

func (*NetworthPet) GetPrice

func (item *NetworthPet) GetPrice() float64

func (*NetworthPet) IsCosmetic

func (item *NetworthPet) IsCosmetic() bool

func (*NetworthPet) IsSoulbound

func (item *NetworthPet) IsSoulbound() bool

type NetworthResult

type NetworthResult struct {
	Networth            float64                  `json:"networth"`
	UnsoulboundNetworth float64                  `json:"unsoulboundNetworth"`
	NoInventory         bool                     `json:"noInventory"`
	IsNonCosmetic       bool                     `json:"isNonCosmetic"`
	Purse               float64                  `json:"purse"`
	Bank                float64                  `json:"bank"`
	PersonalBank        float64                  `json:"personalBank"`
	Types               map[string]*NetworthType `json:"types"`
}

type NetworthType

type NetworthType struct {
	Total            float64              `json:"total"`
	UnsoulboundTotal float64              `json:"unsoulboundTotal"`
	Items            []NetworthItemResult `json:"items"`
}

type ParsedItems

type ParsedItems struct {
	Accessories           []*skycrypttypes.Item `json:"accessories"`
	Armor                 []*skycrypttypes.Item `json:"armor"`
	CandyInventory        []*skycrypttypes.Item `json:"candy_inventory"`
	CarnivalMaskInventory []*skycrypttypes.Item `json:"carnival_mask_inventory"`
	Equipment             []*skycrypttypes.Item `json:"equipment"`
	Enderchest            []*skycrypttypes.Item `json:"enderchest"`
	Essence               []*BasicItem          `json:"essence"`
	FishingBag            []*skycrypttypes.Item `json:"fishing_bag"`
	Inventory             []*skycrypttypes.Item `json:"inventory"`
	PersonalVault         []*skycrypttypes.Item `json:"personal_vault"`
	Pets                  []*skycrypttypes.Pet  `json:"pets"`
	PotionBag             []*skycrypttypes.Item `json:"potion_bag"`
	Quiver                []*skycrypttypes.Item `json:"quiver"`
	Sacks                 []*BasicItem          `json:"sacks"`
	SacksBag              []*skycrypttypes.Item `json:"sacks_bag"`
	Storage               []*skycrypttypes.Item `json:"storage"`
	Wardrobe              []*skycrypttypes.Item `json:"wardrobe"`
	Museum                []*skycrypttypes.Item `json:"museum"`
}

type PetHandler

type PetHandler interface {
	Applies(pet *NetworthPet) bool
	Calculate(pet *NetworthPet, prices map[string]float64)
	IsCosmetic() bool
}

type PrestigeCost

type PrestigeCost struct {
	ItemId string        `json:"item_id"`
	Costs  []UpgradeCost `json:"costs"`
}

type UpgradeCost

type UpgradeCost struct {
	Type        string `json:"type"`
	EssenceType string `json:"essence_type,omitempty"`
	Amount      int    `json:"amount,omitempty"`
	ItemId      string `json:"item_id,omitempty"`
}

Jump to

Keyboard shortcuts

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