Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateCharacter(l *Language, gender string) *rpg.Character
- func GenerateRegionConnections(w *rpg.World)
- func GenerateSubregionConnections(re *rpg.Region, wg *sync.WaitGroup)
- func GenerateWorld(l *Language, complexity uint8) *rpg.World
- func InitRandomTables()
- func PopulateFamilyTree(node *FamilyTreeNode, w *rpg.World, wg *sync.WaitGroup)
- func PopulateRegion(r *rpg.Region, l *Language, complexity uint8, wg *sync.WaitGroup)
- func PopulateWorld(w *rpg.World, l *Language, complexity uint8)
- func RandomGender() string
- func Reseed()
- type Family
- type FamilyTree
- type FamilyTreeNode
- type Language
- type Phonemes
- type Possibility
- type RandomTable
Constants ¶
View Source
const ( GenderMale = "Male" GenderFemale = "Female" )
View Source
const ( TablesPath = "tables" TableBuildingsFileName = "building.txt" TableCharacteristicsFileName = "characteristic.txt" TableProfessionsFileName = "profession.txt" )
View Source
const ( WorldComplexitySimple = 1 WorldComplexityNormal = 2 WorldComplexityLarge = 3 WorldComplexityExtraLarge = 4 )
Variables ¶
View Source
var ( SyllableStructures = []string{"CV", "VC"} ConsonantPresets = []string{"ptkbdgmnlrsqxʧ", "pbgdzklmnrstʤ", "pbgdzklmnrstv"} VowelPresets = []string{"aeiou", "aeio", "aeou"} FinalPresets = []string{"mnsk", "mnŋsk", "mnʃsk"} Orthography = map[string]string{"ʃ": "sh", "ʧ": "ch", "ʤ": "j", "ŋ": "ng", "x": "kh", "ɣ": "gh"} Alphabet = "abcdefghijklmnopqrstuvwxyz" )
View Source
var Genders = []string{GenderMale, GenderFemale}
Functions ¶
func InitRandomTables ¶
func InitRandomTables()
func PopulateFamilyTree ¶
func PopulateFamilyTree(node *FamilyTreeNode, w *rpg.World, wg *sync.WaitGroup)
func PopulateRegion ¶
func RandomGender ¶
func RandomGender() string
Types ¶
type FamilyTree ¶
type FamilyTree struct {
Root FamilyTreeNode
}
func GenerateFamilyTree ¶
func GenerateFamilyTree(f *Family, w *rpg.World, numStartingChildren int) *FamilyTree
type FamilyTreeNode ¶
type FamilyTreeNode struct {
Character *rpg.Character
BirthFamily *Family `json:"-"`
Mother *FamilyTreeNode `json:"-"`
Father *FamilyTreeNode `json:"-"`
Spouse *FamilyTreeNode `json:"-"`
Children []*FamilyTreeNode `json:",omitempty"`
}
func (*FamilyTreeNode) CanHaveChildren ¶
func (n *FamilyTreeNode) CanHaveChildren() bool
func (*FamilyTreeNode) GenerateSpouse ¶
func (n *FamilyTreeNode) GenerateSpouse(w *rpg.World)
func (*FamilyTreeNode) Married ¶
func (n *FamilyTreeNode) Married() bool
func (*FamilyTreeNode) Siblings ¶
func (n *FamilyTreeNode) Siblings() []*FamilyTreeNode
type Language ¶
type Language struct {
*Phonemes
ID primitive.ObjectID `bson:"_id,omitempty"`
Structure string
MinSyllables int8
MaxSyllables int8
}
func GenerateLanguage ¶
func GenerateLanguage() *Language
type Phonemes ¶
Phonemes - https://worldbuildingworkshop.com/constructing-languages/
type Possibility ¶
type Possibility struct {
// contains filtered or unexported fields
}
func NewPossibility ¶
func NewPossibility() *Possibility
func (*Possibility) Increase ¶
func (p *Possibility) Increase()
func (*Possibility) Reduce ¶
func (p *Possibility) Reduce()
type RandomTable ¶
type RandomTable struct {
Name string
Values map[int]string
// contains filtered or unexported fields
}
var ( Tables = []*RandomTable{ &TableBuildings, &TableCharacteristics, &TableProfessions, } TableBuildings RandomTable TableCharacteristics RandomTable TableProfessions RandomTable )
func NewRandomTable ¶
func NewRandomTable(path string) (RandomTable, error)
func (*RandomTable) Parse ¶
func (rt *RandomTable) Parse(path string) error
func (*RandomTable) Roll ¶
func (rt *RandomTable) Roll() string
Click to show internal directories.
Click to hide internal directories.