generator

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	// contains filtered or unexported fields
}

func (Character) Characteristics

func (c Character) Characteristics() map[Characteristic]int

func (Character) CitizenCategory

func (c Character) CitizenCategory() CitizenCategory

func (Character) Experience

func (c Character) Experience() Experience

func (Character) FirstName

func (c Character) FirstName() string

func (Character) FullName

func (c Character) FullName() string

func (Character) Role

func (c Character) Role() Role

func (Character) Skills

func (c Character) Skills() []string

func (Character) String

func (c Character) String() string

String returns a string representation of the character. It is prone to change so you should not rely on it.

func (Character) Surname

func (c Character) Surname() string

type Characteristic

type Characteristic int
const (
	STR Characteristic = iota // Strength
	DEX                       // Dexterity
	END                       // Endurance
	INT                       // Intelligence
	EDU                       // Education
	SOC                       // Social Standing
)

func CharacteristicString

func CharacteristicString(s string) (Characteristic, error)

CharacteristicString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func CharacteristicValues

func CharacteristicValues() []Characteristic

CharacteristicValues returns all values of the enum

func (Characteristic) IsACharacteristic

func (i Characteristic) IsACharacteristic() bool

IsACharacteristic returns "true" if the value is listed in the enum definition. "false" otherwise

func (Characteristic) String

func (i Characteristic) String() string

type CitizenCategory

type CitizenCategory int
const (
	CitizenCategoryBelowAverage CitizenCategory = iota
	CitizenCategoryAverage
	CitizenCategoryAboveAverage
	CitizenCategoryExceptional
)

func CitizenCategoryString

func CitizenCategoryString(s string) (CitizenCategory, error)

CitizenCategoryString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func CitizenCategoryValues

func CitizenCategoryValues() []CitizenCategory

CitizenCategoryValues returns all values of the enum

func (CitizenCategory) IsACitizenCategory

func (i CitizenCategory) IsACitizenCategory() bool

IsACitizenCategory returns "true" if the value is listed in the enum definition. "false" otherwise

func (CitizenCategory) String

func (i CitizenCategory) String() string

type Experience

type Experience int
const (
	ExperienceRecruit Experience = iota
	ExperienceRookie
	ExperienceIntermediate
	ExperienceRegular
	ExperienceVeteran
	ExperienceElite
)

func ExperienceString

func ExperienceString(s string) (Experience, error)

ExperienceString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ExperienceValues

func ExperienceValues() []Experience

ExperienceValues returns all values of the enum

func (Experience) IsAExperience

func (i Experience) IsAExperience() bool

IsAExperience returns "true" if the value is listed in the enum definition. "false" otherwise

func (Experience) String

func (i Experience) String() string

type Gender

type Gender int
const (
	GenderUnspecified Gender = iota
	GenderFemale
	GenderMale
)

func GenderString

func GenderString(s string) (Gender, error)

GenderString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func GenderValues

func GenderValues() []Gender

GenderValues returns all values of the enum

func (Gender) IsAGender

func (i Gender) IsAGender() bool

IsAGender returns "true" if the value is listed in the enum definition. "false" otherwise

func (Gender) String

func (i Gender) String() string

type GenerateCharacterRequest

type GenerateCharacterRequest struct {
	// contains filtered or unexported fields
}

func (GenerateCharacterRequest) Validate

func (r GenerateCharacterRequest) Validate() error

type GenerateCharacterRequestBuilder

type GenerateCharacterRequestBuilder struct {
	// contains filtered or unexported fields
}

func NewGenerateCharacterRequestBuilder

func NewGenerateCharacterRequestBuilder() *GenerateCharacterRequestBuilder

func (*GenerateCharacterRequestBuilder) Build

func (*GenerateCharacterRequestBuilder) CitizenCategory

func (*GenerateCharacterRequestBuilder) Experience

func (*GenerateCharacterRequestBuilder) Gender

func (*GenerateCharacterRequestBuilder) Role

type InvalidListError

type InvalidListError struct {
	// contains filtered or unexported fields
}

func (InvalidListError) Error

func (e InvalidListError) Error() string

type NameGenerator

type NameGenerator interface {
	Generate(gender Gender) (firstName, surname string)
}

func NewCatalogSourcedNameGenerator

func NewCatalogSourcedNameGenerator(surnames, nonGenderNames, femaleFirstNames, maleFirstNames []string) (NameGenerator, error)

NewCatalogSourcedNameGenerator creates a new NameGenerator that generates names from a catalog of names by gender and a list of surnames.

func NewDefaultNameGenerator

func NewDefaultNameGenerator() (NameGenerator, error)

type NpcGenerator

type NpcGenerator struct {
	// contains filtered or unexported fields
}

func (*NpcGenerator) Generate

func (g *NpcGenerator) Generate(request GenerateCharacterRequest) (*Character, error)

type NpcGeneratorBuilder

type NpcGeneratorBuilder struct {
	// contains filtered or unexported fields
}

func NewNpcGeneratorBuilder

func NewNpcGeneratorBuilder() *NpcGeneratorBuilder

func (*NpcGeneratorBuilder) Build

func (b *NpcGeneratorBuilder) Build() (*NpcGenerator, error)

func (*NpcGeneratorBuilder) NameGenerator

func (b *NpcGeneratorBuilder) NameGenerator(nameGenerator NameGenerator) *NpcGeneratorBuilder

type Role

type Role int
const (
	RolePilot Role = iota
	RoleNavigator
	RoleEngineer
	RoleSteward
	RoleMedic
	RoleMarine
	RoleGunner
	RoleScout
	RoleTechnician
	RoleLeader
	RoleDiplomat
	RoleEntertainer
	RoleTrader
	RoleThug
)

func RoleString

func RoleString(s string) (Role, error)

RoleString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func RoleValues

func RoleValues() []Role

RoleValues returns all values of the enum

func (Role) IsARole

func (i Role) IsARole() bool

IsARole returns "true" if the value is listed in the enum definition. "false" otherwise

func (Role) String

func (i Role) String() string

Jump to

Keyboard shortcuts

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