Documentation
¶
Index ¶
- Variables
- func AlphabetizeAndTrimFile(filepath string, species SpeciesInfo) ([]string, error)
- func Generate(enableDebug bool) error
- func GenerateSpecies(speciesStructure []SpeciesInfo) error
- type Names
- type NamesTypes
- type SpeciesData
- type SpeciesInfo
- func OrgnaizeSpeciesData(speciesStructure []SpeciesInfo) ([]SpeciesInfo, error)
- func ProcessSpeciesDataForFolderStructredTextData(speciesMap map[string]interface{}) (speciesStructure []SpeciesInfo, error error)
- func ProcessYAMLAndCreateFiles(filePath string) (SpeciesStructure []SpeciesInfo, error error)
Constants ¶
This section is empty.
Variables ¶
View Source
var EnableDebug bool
View Source
var NamesList = []string{} // List of names for DnD characters /* 7727 elements not displayed */
Functions ¶
func AlphabetizeAndTrimFile ¶
func AlphabetizeAndTrimFile(filepath string, species SpeciesInfo) ([]string, error)
AlphabetizeAndTrimFile reads a text file, sorts lines alphabetically, trims whitespace, and rewrites the file and returns the sorted species data as a slice of strings
func GenerateSpecies ¶
func GenerateSpecies(speciesStructure []SpeciesInfo) error
Generate cmd/species/species.go file species template files
Types ¶
type NamesTypes ¶
type NamesTypes struct { FirstFNames []string `yaml:"FirstFNames,omitempty"` // Field for list FirstMNames []string `yaml:"FirstMNames,omitempty"` // Field for list FirstNBNames []string `yaml:"FirstNBNames,omitempty"` // Field for list Special []string `yaml:"Special,omitempty"` // Field for list Last []string `yaml:"Last,omitempty"` // Field for list }
type SpeciesData ¶
type SpeciesData struct { // Other fields in the struct (if any) Species *[]SpeciesInfo `yaml:"Species"` // Assuming data comes from a YAML file GenericSpeciesInterface string `yaml:"GenericSpeciesInterface,omitempty"` // Field for generic species interface }
type SpeciesInfo ¶
type SpeciesInfo struct { NameOfSpecies string `yaml:"NameOfSpecies"` // Field for species name GlobalVariableName string `yaml:"GlobalVariableName"` // Field for global variable name NameOrder []string `yaml:"NameOrder,omitempty"` // Field for order of names Variable string `yaml:"Variable,omitempty"` // Field for your string value CommandVariable string `yaml:"CommandVariable,omitempty"` // Field for your string value TextFileNames []string `yaml:"TextFileNames,omitempty"` // Field for list of text files Names NamesTypes `yaml:"Names,omitempty"` // Field for list of names }
func OrgnaizeSpeciesData ¶
func OrgnaizeSpeciesData(speciesStructure []SpeciesInfo) ([]SpeciesInfo, error)
OrgnaizeSpeciesData function organizes an array of SpeciesInfo structs by looping throught each SpeciesInfo.TextFileNames and passing the files to AlphabetizeAndTrimFile
func ProcessSpeciesDataForFolderStructredTextData ¶
func ProcessSpeciesDataForFolderStructredTextData(speciesMap map[string]interface{}) (speciesStructure []SpeciesInfo, error error)
ProcessSpeciesData function processes the provided YAML data and creates folders and text files
func ProcessYAMLAndCreateFiles ¶
func ProcessYAMLAndCreateFiles(filePath string) (SpeciesStructure []SpeciesInfo, error error)
ProcessYAMLAndCreateFiles function opens, parses YAML data and creates folders/files
Click to show internal directories.
Click to hide internal directories.