Documentation
¶
Overview ¶
Package professions plans profession leveling and lists the materials worth keeping, from the dataset's recipes and recipe_reagents tables and the captured skills, bags and bank. The rules are in docs/professions.md.
Nothing is inferred: a recipe with no skill-up thresholds, a recipe with no reagent rows and a bank that was never captured are each reported as unknown.
Index ¶
Constants ¶
const ( MinRecipes = 3 MaxRecipes = 5 )
Plan sizes: the fewest and most recipes a plan lists.
const ( Orange = "orange" // below the yellow threshold: always a skill-up Yellow = "yellow" // from the yellow threshold up to grey: still a skill-up Unknown = "unknown" // the dataset has no thresholds for the recipe )
Difficulty of a recipe at the character's skill.
const KeepWindow = 50
KeepWindow is how many skill points above the character's skill a recipe may be learned and still count for the keep list.
Variables ¶
var ErrNoRecipes = errors.New("the dataset has no recipes for the profession")
ErrNoRecipes is returned when the dataset has no recipes for a profession.
Functions ¶
func FarMaterials ¶
FarMaterials returns the reagent item ids, with their professions, of recipes the character cannot learn for more than KeepWindow skill points: materials to bank, not to carry. A profession with no captured skill or no recipes in the dataset contributes nothing.
Types ¶
type Keep ¶
type Keep struct {
ItemID int64
Name string
Count int // bags plus bank
Bags, Bank int
Professions []string
}
Keep is a bag or bank item that is a reagent for a recipe still worth making.
func KeepList ¶
KeepList returns the bag and bank items that are reagents of the character's professions, for recipes learnable within KeepWindow skill points of their current skill and not yet grey, most numerous first. It returns ErrNoRecipes when the dataset has no recipes for any of the professions (the caller then falls back to a guess); a profession whose skill was not captured is skipped.
type Leveling ¶
type Leveling struct {
Profession string
Skill *int
Max *int
Steps []Step
BankKnown bool // false when the bank was never captured: Have counts bags only
Notes []string // everything unknown or missing, in plain words
}
Leveling is the leveling plan for one profession, the result of Plan.
type Reagent ¶
Reagent is one reagent of a planned recipe. Have counts bags and, when captured, bank.
type Recipe ¶
type Recipe struct {
SpellID int64
Name string
CreatesItem int64 // 0 when the recipe makes no item
LearnSkill *int
YellowSkill *int
GreySkill *int
}
Recipe is the part of a recipes row the advisor uses. Rank fields are nil when unknown.
type Step ¶
type Step struct {
Recipe Recipe
CreatesName string // empty when the recipe makes no item or the dataset has no name for it
Difficulty string
Reagents []Reagent
ReagentsKnown bool // false when the dataset lists no reagents for the recipe
}
Step is one recipe in a plan.
func Select ¶
Select picks the recipes a character at skill should make next: those they can already learn (a recipe with no learn skill counts as learnable, and is noted), orange before yellow, and within a difficulty the highest learn skill first, then the lowest spell id. Recipes with no thresholds follow in the same learn-skill order; at most MaxRecipes are returned.