Documentation
¶
Overview ¶
Package skilltree loads rAthena skill_tree.yml (Header SKILL_TREE_DB, Version 1) into a per-job skill tree registry with inheritance resolution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCircularInherit = errors.New("circular Inherit")
ErrCircularInherit is returned (wrapped) when the Inherit graph between jobs contains a cycle. Detect it with errors.Is.
Functions ¶
This section is empty.
Types ¶
type JobTree ¶
type JobTree struct {
Job string
Skills map[string]*SkillEntry
}
JobTree is a single job's resolved skill tree, keyed by skill Name.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a per-job lookup of resolved skill trees.
func Load ¶
Load parses a rAthena skill_tree YAML stream and returns a Registry with all inheritances resolved. It expects Header.Type=="SKILL_TREE_DB" and Header.Version==1, otherwise it returns a wrapped error.
func (*Registry) Get ¶
Get returns the JobTree for the given job name, or (nil, false) if not present. It is nil-safe on a nil receiver.
type SkillEntry ¶
type SkillEntry struct {
Name string
MaxLevel int16
Exclude bool
BaseLevel int16
JobLevel int16
Requires []SkillRequirement
}
SkillEntry is one skill as it appears in a job's resolved tree. Every *SkillEntry stored in a Registry is a unique allocation per (job, skill): mutating the entry returned for one job MUST NOT affect any other job.
type SkillRequirement ¶
SkillRequirement is a prerequisite skill and the level it must reach for another skill in the same job to be unlockable.