towngen

package module
v0.0.0-...-111679d 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: 5 Imported by: 1

README

TownGen

A fantasy town generation library and CLI tool written in Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllTradeGoods

func GetAllTradeGoods(resources []climategen.Resource) []string

GetAllTradeGoods converts a list of resources into a list of trade goods

Types

type NamePattern

type NamePattern struct {
	Type     string
	Prefixes []string
	Suffixes []string
}

NamePattern is a type of naming style for town names

type Town

type Town struct {
	Name       string
	Population int
	Category   TownCategory
	Climate    climategen.Climate
	Culture    culturegen.Culture
	Mayor      chargen.Character
	Exports    []TradeGood
	Imports    []TradeGood
}

Town is a town

func GenerateTown

func GenerateTown(category string, climate string) Town

GenerateTown generates a random town

func SetCulture

func SetCulture(culture culturegen.Culture, town Town) Town

SetCulture sets the culture of a town and recalculates some things

type TownCategory

type TownCategory struct {
	Name       string
	MinSize    int
	MaxSize    int
	MinExports int
	MaxExports int
	MinImports int
	MaxImports int
}

TownCategory is a type of town

type TradeGood

type TradeGood struct {
	Name    string
	Quality string
	Amount  int
}

TradeGood is a trade good entry

Directories

Path Synopsis
cmd
towngend command

Jump to

Keyboard shortcuts

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