profile

package
v0.7.15 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package profile keeps each character's play style and talent plan on the player's own machine (the user config directory, never a repo), and checks a plan against the captured talent tree.

A plan holds node names and target ranks only. Guide text is never stored here.

Index

Constants

View Source
const (
	MaxPicks  = 120
	MaxField  = 120
	MaxURLLen = 300
)

Limits on what is stored.

View Source
const Env = "WOWC_PROFILES"

Env overrides the store's path.

Variables

View Source
var (
	Roles = []string{"damage", "tank", "healer", "balanced"}
	Foci  = []string{"leveling", "dungeons", "pvp", "mixed"}
	// StatPrefs are the optional stat preferences ("" is balanced): see the stats package.
	StatPrefs = []string{"", "balanced", "damage", "survival"}
)

Allowed values, first is listed first in the question the model asks.

Functions

func Ask

func Ask() string

Ask is the short multiple-choice question the model puts to a player who has no saved play style, before it gives any talent advice. The answer is saved with set_character_profile.

func Attach

Attach returns c with its stored profile and plan; c is unchanged when path holds neither.

func Clean

Clean checks a profile: role and focus are from the allowed lists (case-insensitive, lower-cased on save), the spec is short text and the guide is an https URL.

func Overview

func Overview(class string) string

Overview is the Icy Veins WoW: Forever class overview page, where the guide for a spec is found.

func Path

func Path() string

Path is the store file: $WOWC_PROFILES, else <user config dir>/wowc-advisor/profiles.json; empty when the system has no config directory.

Types

type Check

type Check struct {
	Plan    character.TalentPlan
	Dropped []string // entries not in the captured tree, or with a bad rank, with the reason
}

Check is the result of validating a plan against the captured tree.

func ValidatePlan

func ValidatePlan(c character.Character, p character.TalentPlan) (Check, error)

ValidatePlan keeps the picks that name a node of the captured class tree (matched by name, case-insensitively, and written back with the captured spelling) and a rank from 1 to its max rank; the rest are dropped and listed. A repeated node keeps its first place and its highest rank. An error means nothing usable is left.

type Entry

type Entry struct {
	Profile *character.Profile    `json:"profile,omitempty"`
	Plan    *character.TalentPlan `json:"plan,omitempty"`
}

Entry is everything stored for one character.

func Get

func Get(path, key string) Entry

Get reads one character's entry; the zero Entry when there is none or the file is unreadable.

func Update

func Update(path, key string, fn func(*Entry) error) (Entry, error)

Update reads the character's entry, lets fn change it and writes the file back atomically (mode 0600). A file that cannot be parsed is an error, never overwritten.

Jump to

Keyboard shortcuts

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