chargen

package module
v0.0.0-...-7392a55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2019 License: Apache-2.0 Imports: 4 Imported by: 2

README

CharGen

This is a character generation library for Go. It includes a CLI tool for generating characters and an API that outputs JSON.

The output is character traits and descriptions. It's intended for use in describing characters for tabletop role-playing games and other uses.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	FirstName           string
	LastName            string
	Gender              string
	Age                 int
	AgeCategory         string
	Orientation         string
	Height              int
	Weight              int
	Profession          string
	Hobby               Hobby
	PsychologicalTraits []string
	Motivation          string
	HairColor           string
	HairStyle           string
	FacialHair          string
	EyeColor            string
	FaceShape           string
	MouthShape          string
	NoseShape           string
	Culture             culturegen.Culture
}

Character is a character

func GenerateAdultDescendent

func GenerateAdultDescendent(couple Couple) Character

GenerateAdultDescendent generates an adult character based on a couple

func GenerateCharacter

func GenerateCharacter() Character

GenerateCharacter generates a random character

func GenerateCharacterOfCulture

func GenerateCharacterOfCulture(culture culturegen.Culture) Character

GenerateCharacterOfCulture generates a random character with a given culture

func GenerateChild

func GenerateChild(couple Couple) Character

GenerateChild generates a child character for a couple

func GenerateCompatibleMate

func GenerateCompatibleMate(char Character) Character

GenerateCompatibleMate generates a character appropriate as a mate for another

func (Character) SetCulture

func (character Character) SetCulture(culture culturegen.Culture) Character

SetCulture sets the culture of the character

type Couple

type Couple struct {
	Partner1        Character
	Partner2        Character
	CanHaveChildren bool
}

Couple is a pair of partners

func GenerateCouple

func GenerateCouple() Couple

GenerateCouple generates a couple

func MarryCouple

func MarryCouple(partner1 Character, partner2 Character) Couple

MarryCouple returns a couple from two characters

type Family

type Family struct {
	FamilyName string
	Parents    Couple
	Children   []Character
}

Family is a family of characters

func GenerateFamily

func GenerateFamily() Family

GenerateFamily generates a random family

type Hobby

type Hobby struct {
	Name           string
	RequiresOthers bool
	IsAdultOnly    bool
	IsChildOnly    bool
}

Hobby is a pasttime

Directories

Path Synopsis
cmd
chargend command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL