addon

package
v0.0.0-...-c98b16f Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertTime = time.Minute * 30
	WarnTime  = time.Hour * 1
)
View Source
const (
	PollingInterval time.Duration = time.Millisecond * 100
	RetryInterval   time.Duration = time.Millisecond * 500
	MaxRetries      int           = 3
)

Variables

View Source
var (

	// The saved variables file is empty.
	ErrAddonContentsEmpty = errors.New("error parsing file: contents empty")

	// Error decoding 0 bytes.
	ErrDecodeData = errors.New("error decoding data: nil or empty byte array")

	// Error decompressing data.
	ErrDecompressData = errors.New("error decompressing data")

	// Export string not found in saved variables file.
	ErrExportMatchNotFound = errors.New("export match not found")
)

Functions

This section is empty.

Types

type AdventureTable

type AdventureTable struct {
	Type      GarrisonFollowerType
	Followers map[string]*FollowerInfo `json:",omitempty"` //nolint:tagliatelle
	Missions  []*MissionDetail
}

func (*AdventureTable) ActiveCompanions

func (t *AdventureTable) ActiveCompanions() []*FollowerInfo

func (*AdventureTable) Companions

func (t *AdventureTable) Companions() []*FollowerInfo

func (*AdventureTable) CompanionsOnMission

func (t *AdventureTable) CompanionsOnMission(m *MissionDetail) []*FollowerInfo

func (*AdventureTable) IdleCompanions

func (t *AdventureTable) IdleCompanions() []*FollowerInfo

func (*AdventureTable) MissionsActive

func (t *AdventureTable) MissionsActive() []*MissionDetail

func (*AdventureTable) MissionsComplete

func (t *AdventureTable) MissionsComplete() []*MissionDetail

func (*AdventureTable) NumCompanions

func (t *AdventureTable) NumCompanions() int

type AdventureTables

type AdventureTables map[string]*AdventureTable

type Character

type Character struct {
	Key             string
	Class           string
	Gender          string
	LastSeen        int
	Level           int
	Money           int
	MoneyText       string
	Name            string
	PlayedLevel     int
	PlayedTotal     int
	Race            string
	Realm           string
	ReservoirAnima  int
	AdventureTables AdventureTables
}

func (*Character) String

func (char *Character) String() string

func (*Character) Table

func (char *Character) Table(followerType GarrisonFollowerType) *AdventureTable

type CurrencyReward

type CurrencyReward struct {
	CurrencyID int
	Icon       interface{}
	Quantity   int
	Title      string
}

func (CurrencyReward) String

func (cr CurrencyReward) String() string

type Data

type Data struct {
	Characters map[string]*Character
}

func (*Data) CharacterKeys

func (d *Data) CharacterKeys() []string

func (*Data) NumMissionsActive

func (d *Data) NumMissionsActive(followerType GarrisonFollowerType) int

func (*Data) NumMissionsComplete

func (d *Data) NumMissionsComplete(followerType GarrisonFollowerType) int

type EncounterIconInfo

type EncounterIconInfo struct {
	IsElite            bool
	IsRare             bool
	MissionScalar      int
	PortraitFileDataID int
}

type FollowerInfo

type FollowerInfo struct {
	FollowerTypeID GarrisonFollowerType
	Health         int
	IsAutoTroop    bool
	IsSoulbind     bool
	Level          int
	LevelXP        int
	MaxHealth      int
	Name           string
	Role           int
	Xp             int
}

type GarrisonFollowerType

type GarrisonFollowerType int

https://wowpedia.fandom.com/wiki/Enum.GarrisonFollowerType

const (
	// Garrison follower type.
	FollowerType_6_0 GarrisonFollowerType = 1 //nolint:golint,revive
	// Shipyard follower type.
	FollowerType_6_2 GarrisonFollowerType = 2 //nolint:golint,revive
	// Legion follower type.
	FollowerType_7_0 GarrisonFollowerType = 4 //nolint:golint,revive
	// Battle for Azeroth follower type.
	FollowerType_8_0 GarrisonFollowerType = 22 //nolint:golint,revive
	// Shadowlands follower type.
	FollowerType_9_0 GarrisonFollowerType = 123 //nolint:golint,revive
)

type ItemReward

type ItemReward struct {
	ItemID   int
	ItemLink string
	Quantity int
}

func (ItemReward) String

func (ir ItemReward) String() string

type MissionDetail

type MissionDetail struct {
	BaseCost            int
	CharText            string
	Cost                int
	CostCurrencyTypesID int
	DurationSeconds     int
	EncounterIconInfo   *EncounterIconInfo
	Followers           []string
	FollowerInfo        map[string]*FollowerInfo
	FollowerTypeID      GarrisonFollowerType // Enum.GarrisonFollowerType
	InProgress          bool
	MissionEndTime      int64
	MissionID           int
	MissionScalar       int
	Name                string
	Rewards             []*json.RawMessage // one of a few reward types -- currency, item, xp
	Type                string
	Xp                  int
}

func (*MissionDetail) BonusReward

func (m *MissionDetail) BonusReward() string

func (*MissionDetail) IsComplete

func (m *MissionDetail) IsComplete() bool

func (*MissionDetail) TimeRemaining

func (m *MissionDetail) TimeRemaining() (s string)

type SavedVariables

type SavedVariables struct {
	Current *Data
	Data    chan *Data
	File    string
	// contains filtered or unexported fields
}

func NewSV

func NewSV(name string) *SavedVariables

func (*SavedVariables) LoadAddonData

func (sv *SavedVariables) LoadAddonData() error

func (*SavedVariables) TriggerWrite

func (sv *SavedVariables) TriggerWrite()

func (*SavedVariables) Watch

func (sv *SavedVariables) Watch(ctx context.Context) error

type XPReward

type XPReward struct {
	FollowerXP int
	Icon       string
	Name       string
	Title      string
	Tooltip    string
}

func (XPReward) String

func (xr XPReward) String() string

Jump to

Keyboard shortcuts

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