Documentation
¶
Overview ¶
Package progress persists the player's journey to a versioned JSON file.
Index ¶
Constants ¶
View Source
const Version = 2
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Progress ¶
type Progress struct {
Version int `json:"version"`
XP int `json:"xp"`
Level int `json:"level"`
Stars map[string]int `json:"stars"`
Completed []string `json:"completed"`
Badges []string `json:"badges"`
LastLesson string `json:"lastLesson"`
}
func Load ¶
Load never fails: missing, corrupt, or old-version files yield a fresh Progress (old files are kept as <path>.v1.bak).
func (*Progress) IsCompleted ¶
func (*Progress) MarkCompleted ¶
Click to show internal directories.
Click to hide internal directories.