Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPossibleProfessions ¶
func GetPossibleProfessions(resources []resource.Resource) ([]profession.Profession, error)
GetPossibleProfessions gets all possible professions for a given set of resources
Types ¶
type Data ¶
type Data struct {
Patterns []Pattern `json:"patterns"`
}
Data is a collection of patterns
type Pattern ¶
type Pattern struct { Name string `json:"name" db:"name"` Description string `json:"description" db:"description"` Tags []string `json:"tags" db:"tags"` Commonality int `json:"commonality" db:"commonality"` ProfessionName string `json:"profession_name" db:"profession_name"` Slots []Slot `json:"slots" db:"slots"` NameTemplate string `json:"name_template" db:"name_template"` MainMaterial string `json:"main_material" db:"main_material"` MainMaterialOverride string `json:"main_material_override" db:"main_material_override"` OriginOverride string `json:"origin_override" db:"origin_override"` Value int `json:"value" db:"value"` }
Pattern is a pattern for a resource
func ForProfession ¶
func ForProfession(prof profession.Profession, from []Pattern) []Pattern
ForProfession returns all patterns from the set that a profession can make
func LoadFromFile ¶
LoadFromFile loads patterns from the given JSON file
func (Pattern) RenderDescription ¶
RenderDescription turns a completed pattern into a string description
func (Pattern) RenderName ¶
RenderName renders the name of a completed pattern
type Slot ¶
type Slot struct { Name string `json:"name" db:"name"` RequiredTag string `json:"required_tag" db:"required_tag"` Resource resource.Resource `json:"resource" db:"resource"` DescriptionTemplate string `json:"description_template" db:"description_template"` PossibleQuirks []string `json:"possible_quirks" db:"possible_quirks"` }
Slot is a slot for a resource requirement
Click to show internal directories.
Click to hide internal directories.