Documentation
¶
Index ¶
Constants ¶
const Version = "0.0.1"
Version defines the version of the h3 package
Variables ¶
var ( // ErrInvalidLevel is thrown when a level could not be parsed from it's string ErrInvalidLevel = errors.New("invalid level supplied") // ValidLevels is a map of valid levels and their descriptions ValidLevels = map[Level]string{ Unfamiliar: "Subject was unfamiliar with the subject", Beginner: "Subject had a beginner level understanding of the subject", Moderate: "Subject had a moderate level understanding of the subject", Advanced: "Subject had an advanced level understanding of the subject", Expert: "Subject had an expert level understanding of the subject", } )
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
Name string `json:"name"`
CN string `json:"cn"`
Path string `json:"path"`
Type string `json:"type"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Weight int `json:"weight,omitempty"`
Parent *Element `json:"-"`
Universe *Universe `json:"-"`
Children map[string]*Element `json:"children,omitempty"`
UserScore Level `json:"user_score,omitempty"`
Rubric Rubric `json:"rubric,omitempty"`
Tree gotree.Tree `json:"-"`
}
Element describes a single leaf in the skill tree
type Level ¶
type Level int
Level represents the skill level that can be assigned to a skill in the tree
const ( // Unfamiliar means the user had zero knowledge of the topic Unfamiliar Level = iota // Beginner means the user had a beginner level understanding of the topic Beginner // Moderate means the user had a moderate level understanding of the topic Moderate // Advanced means the user had an advanced level understanding of the topic Advanced // Expert means the user had an expert level understanding of the topic Expert )
func LevelFromWord ¶
LevelFromWord attempts to parse a Level from it's string representation
func (Level) MarshalJSON ¶
MarshalJSON implements the JSONMarshaler for the Level type
func (Level) UnmarshalJSON ¶
UnmarshalJSON implements the JSONUnmarshaler for the Level type
type Rubric ¶
Rubric represents a scoring rubric for a specific skill tree element
func (Rubric) MarshalJSON ¶
MarshalJSON implements the JSONMarshaler for the Rubric type
func (Rubric) UnmarshalJSON ¶
UnmarshalJSON implements the JSONUnmarshaler for the Rubric type
type Universe ¶
type Universe struct {
Elms []*Element `json:"-"`
ByPath map[string]*Element `json:"-"`
TopLevel map[string]*Element `json:"universe"`
Tree gotree.Tree `json:"-"`
}
Universe manages the top level skill tree
func (*Universe) NewTopLevelElement ¶
NewTopLevelElement creates a new top level element in the universe