Documentation
¶
Overview ¶
Package profession provides fantasy professions and metadata for them
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Names ¶
func Names(professions []Profession) []string
Names returns a slice of just the names of a list of professions
Types ¶
type Data ¶
type Data struct {
Professions []Profession `json:"professions"`
}
Data is a struct containing a slice of professions
type Profession ¶
type Profession struct { Name string `json:"name" db:"name"` Description string `json:"description" db:"description"` Tags []string `json:"tags"` }
Profession is a person with a particular skillset that can make a resource
func ByTag ¶
func ByTag(tag string) ([]Profession, error)
ByTag returns a slice of professions that have the given tag
func Random ¶
func Random() (Profession, error)
Random returns a single random profession from all professions
func RandomSet ¶
func RandomSet(max int, possible []Profession) ([]Profession, error)
RandomSet returns a random number of professions from a given set of professions
func (Profession) HasTag ¶
func (profession Profession) HasTag(tag string) bool
HasTag returns true if the profession has a given tag
func (Profession) InSlice ¶
func (profession Profession) InSlice(professions []Profession) bool
InSlice returns true if the given profession is in the slice
Click to show internal directories.
Click to hide internal directories.