models

package
v0.0.0-...-2aa414d Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Armors categories.
	Armors = []string{"armor", "armour", "armors", "armours"}

	// Weapons categories.
	Weapons = []string{"weapon", "weapons"}

	// Accessories categories.
	Accessories = []string{"accessory", "accessories"}

	// Currencies categories.
	Currencies = []string{"currency", "currencies"}
	// Oils categories.
	Oils = append(Currencies, "oil", "oils")
	// Fossils categories.
	Fossils = append(Currencies, "fossil", "fossils")
	// Essences categories.
	Essences = append(Currencies, "essence", "essences")

	// Jewels categories.
	Jewels = []string{"jewel", "jewels"}
	// Gems categories.
	Gems = []string{"gem", "gems"}
	// Maps categories.
	Maps = []string{"map", "maps"}
	// Cards categories.
	Cards = []string{"card", "cards"}
	// Quests categories.
	Quests = []string{"quest", "quests"}
)
View Source
var BaseTypes = map[string][]string{}/* 751 elements not displayed */

BaseTypes holds all objects base types in the game.

View Source
var (
	// CurrencyExchangeRate holds all the currency converted in chaos.
	CurrencyExchangeRate = map[string]float64{
		"Ancient Orb":                       27,
		"Ancient Shard":                     2,
		"Annulment Shard":                   3,
		"Apprentice Cartographer's Sextant": 1.1,
		"Armourer's Scrap":                  1 / 44,
		"Binding Shard":                     1 / 2,
		"Blacksmith's Whetstone":            1 / 32.3,
		"Blessed Orb":                       3.9,
		"Blessing of Chayula":               162.4,
		"Blessing of Esh":                   3.3,
		"Blessing of Tul":                   4,
		"Blessing of Uul-Netol":             7.4,
		"Blessing of Xoph":                  3,
		"Cartographer's Chisel":             1 / 2.3,
		"Chaos Orb":                         1,
		"Chaos Shard":                       1 / 20,
		"Chromatic Orb":                     1 / 4.3,
		"Divine Orb":                        40,
		"Engineer's Orb":                    1 / 1.2,
		"Engineer's Shard":                  60,
		"Eternal Orb":                       36500,
		"Exalted Orb":                       163.5,
		"Exalted Shard":                     7,
		"Gemcutter's Prism":                 1 / 1.9,
		"Glassblower's Bauble":              1 / 9.4,
		"Harbinger's Orb":                   28,
		"Harbinger's Shard":                 2,
		"Horizon Shard":                     1 / 20,
		"Jeweller's Orb":                    1 / 6.2,
		"Journeyman Cartographer's Sextant": 2.8,
		"Master Cartographer's Sextant":     3.7,
		"Mirror of Kalandra":                38700,
		"Mirror Shard":                      38700 / 20,
		"Orb of Alchemy":                    1 / 2.5,
		"Orb of Alteration":                 1 / 3.6,
		"Orb of Annulment":                  50,
		"Orb of Augmentation":               1 / 37.1,
		"Orb of Binding":                    1 / 3,
		"Orb of Chance":                     1 / 6.5,
		"Orb of Fusing":                     1 / 1.5,
		"Orb of Horizons":                   1,
		"Orb of Regret":                     1.6,
		"Orb of Scouring":                   1 / 1.2,
		"Orb of Transmutation":              1 / 60,
		"Perandus Coin":                     1 / 70,
		"Portal Scroll":                     1 / 54.9,
		"Regal Orb":                         1 / 1.4,
		"Regal Shard":                       (1 / 1.4) / 20,
		"Scroll of Wisdom":                  1 / 111.5,
		"Silver Coin":                       1 / 4.1,
		"Splinter of Chayula":               1.9,
		"Splinter of Esh":                   1 / 8,
		"Splinter of Tul":                   1 / 7.1,
		"Splinter of Uul-Netol":             1 / 3.1,
		"Splinter of Xoph":                  1 / 4.9,
		"Stacked Deck":                      1 / 7.4,
		"Timeless Eternal Empire Splinter":  1 / 7,
		"Timeless Karui Splinter":           1 / 11,
		"Timeless Maraketh Splinter":        1 / 2,
		"Timeless Templar Splinter":         1 / 2,
		"Timeless Vaal Splinter":            1 / 6,
		"Vaal Orb":                          1.6,
	}
)
View Source
var DefaultInventoryLayout = map[string]float64{
	"MainInventoryX": 14,
	"MainInventoryY": 531.568,
	"FlaskX0":        186.339,
	"FlaskX1":        234.803,
	"FlaskX2":        281.268,
	"FlaskX3":        328.732,
	"FlaskX4":        376.197,
	"FlaskY":         418.511,
	"BodyArmourX":    252.059,
	"BodyArmourY":    206.138,
	"RingX":          182.688,
	"RingY":          253.602,
	"Ring2X":         368.895,
	"Ring2Y":         253.602,
	"BootsX":         368.895,
	"BootsY":         312.629,
	"GlovesX":        135.223,
	"GlovesY":        312.629,
	"HelmX":          252.059,
	"HelmY":          99.6471,
	"AmuletX":        368.895,
	"AmuletY":        194.576,
	"WeaponX":        65.8519,
	"WeaponY":        111.209,
	"Weapon2X":       65.8519,
	"Weapon2Y":       111.209,
	"BeltX":          252.059,
	"BeltY":          360.093,
	"OffhandX":       438.266,
	"OffhandY":       111.209,
	"Offhand2X":      438.266,
	"Offhand2Y":      111.209,
}

DefaultInventoryLayout is the default mapping for placing inventory items correctly.

View Source
var ExperienceTable = []int64{}/* 101 elements not displayed */

ExperienceTable holds all xp repartition.

Functions

func CurrentXp

func CurrentXp(xp int64, level int) int64

CurrentXp returns the xp gain for this current level.

func PrettyPrint

func PrettyPrint(n int64) string

PrettyPrint write string with space separators.

func XpNeeded

func XpNeeded(level int) int64

XpNeeded returns the remaining XP needed for the next level.

func XpToNextLevel

func XpToNextLevel(level int) int64

XpToNextLevel retrieves xp needed for the next level.

Types

type Badge

type Badge struct {
	Name string
	URL  string
}

Badge user profile badge

type CardLayout

type CardLayout struct {
	Name string `json:"name"`
}

CardLayout is used for the divination card layout.

type Category

type Category struct {
	Armor       *[]string `json:"armour"`
	Accessories *[]string `json:"accessories"`
	Currency    *[]string `json:"currency"`
	Jewels      *[]string `json:"jewels"`
	Weapons     *[]string `json:"weapons"`
	Gems        *[]string `json:"gems"`
	Maps        *[]string `json:"maps"`
}

Category is the type of category of an item.

type Character

type Character struct {
	Expired         bool   `json:"expired"`
	LastActive      bool   `json:"lastActive"`
	Level           int    `json:"level"`
	AscendancyClass int    `json:"ascendancyClass"`
	ClassID         int    `json:"classId"`
	Experience      int64  `json:"experience"`
	Name            string `json:"name"`
	League          string `json:"league"`
	Class           string `json:"class"`
}

Character profile character

func ParseCharacters

func ParseCharacters(data []byte) ([]*Character, error)

ParseCharacters parses a Path of Exile characters.

func (*Character) String

func (c *Character) String() string

String converts this structure to its string representation.

type CharacterInventory

type CharacterInventory struct {
	CharDesc Character `json:"character"`
	Items    []*Item   `json:"items"`
}

CharacterInventory holds inventory of a character.

func ParseInventory

func ParseInventory(data []byte) (*CharacterInventory, error)

ParseInventory parses a Path of Exile character inventory.

func (*CharacterInventory) String

func (c *CharacterInventory) String() string

String converts this structure to its string representation.

type CharacterSkills

type CharacterSkills struct {
	Hashes     []int   `json:"hashes"`
	Items      []*Item `json:"items"`
	JewelSlots []int   `json:"jewel_slots"`
}

CharacterSkills holds all skills chosen by the character and also all items (jewels or abyss) put in the slots.

func ParseSkills

func ParseSkills(data []byte) (*CharacterSkills, error)

ParseSkills parses a Path of Exile character skills.

func (*CharacterSkills) String

func (c *CharacterSkills) String() string

String converts this structure to its string representation.

type Color

type Color struct {
	R int
	G int
	B int
}

Color holds primary colors.

type DemoConfig

type DemoConfig struct {
	// Dummy info.
	Account string
	League  string
	Realm   string

	// Pathfiles.
	Characters string
	Skills     []string
	Stash      []string
}

DemoConfig hold pathname of all mocked info.

func ParseDemoConfig

func ParseDemoConfig(data []byte) (DemoConfig, error)

ParseDemoConfig parses a demo config file.

type DivineLayout

type DivineLayout struct {
	Height int          `json:"h"`
	Width  int          `json:"w"`
	PadX   int          `json:"padx"`
	PadY   int          `json:"pady"`
	Scale  float64      `json:"scale"`
	Cards  []CardLayout `json:"cards"`
}

DivineLayout hold the divination layout information.

type FragmentLayoutType

type FragmentLayoutType struct {
	Sections []string          `json:"sections"`
	Layouts  map[string]Layout `json:"layout"`
}

FragmentLayoutType hold fragment layout information.

type FrameType

type FrameType int

FrameType is a type of rarity of an item.

const (
	NormalItemFrameType FrameType = iota
	MagicItemFrameType
	RareItemFrameType
	UniqueItemFrameType
	GemFrameType
	CurrencyFrameType
	DivinationCardFrameType
	QuestItemFrameType
	ProphecyFrameType
	RelicFrameType
)

Frame type represents the type of frame to draw for an item.

type HybridType

type HybridType struct {
	IsVaalGem             bool           `json:"isVaalGem"`
	BaseTypeName          string         `json:"baseTypeName"`
	SecondDescriptionText string         `json:"secDescrText"`
	Properties            []ItemProperty `json:"properties"`
	ExplicitMods          []string       `json:"explicitMods"`
}

HybridType represent vaal gems additional properties.

type IncubatedItemType

type IncubatedItemType struct {
	Name     string `json:"name"`
	Level    int    `json:"level"`
	Progress int    `json:"progress"`
	Total    int    `json:"total"`
}

IncubatedItemType holds information about incubated item attached on an item.

type InfluenceProperty

type InfluenceProperty struct {
	Elder    bool `json:"elder"`
	Shaper   bool `json:"shaper"`
	Crusader bool `json:"crusader"`
	Hunter   bool `json:"hunter"`
	Redeemer bool `json:"redeemer"`
	Warlord  bool `json:"warlord"`
}

InfluenceProperty holds which type of influences affect the item.

type Item

type Item struct {
	IsVerified          bool `json:"verified"`
	IsIdentified        bool `json:"identified"`
	IsCorrupted         bool `json:"corrupted"`
	IsSynthesised       bool `json:"synthesised"`
	IsLockedToCharacter bool `json:"lockedToCharacter"`
	IsSupport           bool `json:"support"`
	IsRelic             bool `json:"isRelic"`
	IsAbyssJewel        bool `json:"abyssJewel"`
	IsVeiled            bool `json:"veiled"`
	IsDuplicated        bool `json:"duplicated"`

	Width        int `json:"w"`
	Height       int `json:"h"`
	ItemLevel    int `json:"ilvl"`
	StackSize    int `json:"stackSize"`
	MaxStackSize int `json:"maxStackSize"`
	X            int `json:"x"`
	Y            int `json:"y"`
	TalismanTier int `json:"talismanTier"`
	Socket       int `json:"socket"`

	FrameType FrameType `json:"frameType"`

	// Names for some items may include markup. For example: <<set:MS>><<set:M>><<set:S>>Roth's Reach
	Name                   string `json:"name"`
	Type                   string `json:"typeLine"`
	Icon                   string `json:"icon"`
	League                 string `json:"league"`
	Id                     string `json:"id"`
	DescriptionText        string `json:"descrText"`
	SecondDescriptionText  string `json:"secDescrText"`
	ArtFilename            string `json:"artFilename"`
	InventoryId            string `json:"inventoryId"`
	ProphecyText           string `json:"prophecyText"`
	ProphecyDifficultyText string `json:"prophecyDiffText"`
	Note                   string `json:"note"`
	SocketColor            string `json:"colour"`

	Influences           InfluenceProperty `json:"influences"`
	Properties           []ItemProperty    `json:"properties"`
	AdditionalProperties []ItemProperty    `json:"additionalProperties"`
	Requirements         []ItemProperty    `json:"requirements"`

	Sockets       []Socket `json:"sockets"`
	SocketedItems []Item   `json:"socketedItems"`

	ExplicitMods []string `json:"explicitMods"`
	ImplicitMods []string `json:"implicitMods"`
	UtilityMods  []string `json:"utilityMods"`
	EnchantMods  []string `json:"enchantMods"`
	CraftedMods  []string `json:"craftedMods"`
	CosmeticMods []string `json:"cosmeticMods"`
	VeiledMods   []string `json:"veiledMods"`
	FlavorText   []string `json:"flavourText"`

	Category      Category          `json:"category"`
	Hybrid        HybridType        `json:"hybrid"`
	IncubatedItem IncubatedItemType `json:"incubatedItem"`
}

Item is a description of all properties of a single item.

type ItemProperty

type ItemProperty struct {
	Name        string        `json:"name"`
	Values      []interface{} `json:"values"`
	DisplayMode int           `json:"displayMode"`
	Progress    float64       `json:"progress"`
}

ItemProperty holds item properties (name, how to display, ...).

type Layout

type Layout struct {
	Type    LayoutType // Not mapped used internally.
	Section string     `json:"section"`
	X       float64    `json:"x"`
	Y       float64    `json:"y"`
	W       int        `json:"w"`
	H       int        `json:"h"`
	Scale   float64    `json:"scale"`
}

Layout is used for custom layout like currency.

type LayoutType

type LayoutType string

LayoutType is the type of layout.

const (
	DefaultLayout    LayoutType = ""
	CurrencyLayout   LayoutType = "currency"
	InventoryLayout  LayoutType = "inventory"
	JewelLayout      LayoutType = "jewel"
	FragmentLayout   LayoutType = "fragment"
	MapLayout        LayoutType = "map"
	QuadLayout       LayoutType = "quad"
	EssenceLayout    LayoutType = "essence"
	DivinationLayout LayoutType = "divination"
	UniqueLayout     LayoutType = "unique"
)

Layout is the type of layout to use (type of grid to place items).

type League

type League struct {
	Id         string    `json:"id"`
	Realm      string    `json:"realm"`
	Url        string    `json:"url"`
	StartAt    time.Time `json:"startAt"`
	EndAt      time.Time `json:"endAt"`
	DelveEvent bool      `json:"delveEven"`
}

League represents a league and its characteristics.

func ParseLeagues

func ParseLeagues(data []byte) ([]*League, error)

ParseLeagues parses a Path of Exile leagues list.

type Profile

type Profile struct {
	GuildName   string
	GuildURL    string
	GuildID     int
	ForumPosts  int
	JoinedAt    time.Time
	LastVisited time.Time
	Badges      []*Badge
	Characters  []*Character
}

Profile website account profile

type Socket

type Socket struct {
	GroupId   int    `json:"group"`
	Attribute string `json:"attr"`
	Color     string `json:"sColour"`
}

Socket describes a socket.

type StashTab

type StashTab struct {
	NumTabs          int                `json:"numTabs"`
	QuadLayout       bool               `json:"quadLayout"`
	Items            []Item             `json:"items"`
	Tabs             []Tab              `json:"tabs"`
	CurrencyLayout   map[string]Layout  `json:"currencyLayout"`
	FragmentLayout   FragmentLayoutType `json:"fragmentLayout"`
	EssenceLayout    map[string]Layout  `json:"essenceLayout"`
	DivinationLayout DivineLayout       `json:"divinationLayout"`

	// Can be empty, hence the *, for allowing to be nullable.
	MapLayout    *map[string]Layout `json:"mapLayout"`
	UniqueLayout *map[string]Layout `json:"uniqueLayout"`
}

StashTab holds all stash tabulations (thus all items).

func ParseStashTab

func ParseStashTab(data []byte) (*StashTab, error)

ParseStashTab parses a Path of Exile stash tabulation.

func (*StashTab) String

func (s *StashTab) String() string

type Tab

type Tab struct {
	Hidden          bool   `json:"hidden"`
	Selected        bool   `json:"selected"`
	Index           int    `json:"i"`
	BackgroundColor Color  `json:"colour"`
	Name            string `json:"n"`
	Id              string `json:"id"`
	Type            string `json:"type"`
	ImgL            string `json:"srcL"`
	ImgC            string `json:"srcC"`
	ImgR            string `json:"srcR"`
}

Tab describes a tabulation style (background color, custom name, style, and so on)

type WealthBreakdown

type WealthBreakdown struct {
	EstimatedChaos int
	NbAlch         int
	NbChaos        int
	NbExa          int
}

WealthBreakdown holds total wealth and its details.

func ComputeWealth

func ComputeWealth(stashTabs []*StashTab, characters []*CharacterInventory) WealthBreakdown

ComputeWealth computes the wealth in chaos orbs contained in a stash.

Jump to

Keyboard shortcuts

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