region

package
v0.0.0-...-a30bc99 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package region provides tools and structures for fantasy regions of a world

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	MaxNumberOfTowns         int    `json:"max_number_of_towns"`
	MinNumberOfTowns         int    `json:"min_number_of_towns"`
	Name                     string `json:"name"`
	RulerTitleFemale         string `json:"ruler_title_female"`
	RulerTitleMale           string `json:"ruler_title_male"`
	Commonality              int    `json:"commonality"`
	NumberOfTiles            int    `json:"number_of_tiles"`
	MinNumberOfOrganizations int    `json:"min_number_of_organizations"`
	MaxNumberOfOrganizations int    `json:"max_number_of_organizations"`
}

Class is a class of region

type Region

type Region struct {
	AreaDescription string                      `json:"area_description"`
	Biome           string                      `json:"biome"`
	Capital         string                      `json:"capital"`
	Class           Class                       `json:"class"`
	Geography       geography.Area              `json:"geography"`
	Culture         culture.Culture             `json:"culture"`
	Name            string                      `json:"name"`
	Organizations   []organization.Organization `json:"organizations"`
	RulingBody      organization.Organization   `json:"ruling_body"`
	TilesOccupied   []geometry.Point            `json:"tiles_occupied"`
	Towns           []town.Town                 `json:"town"`
}

Region is a map region

func Generate

func Generate(area geography.Area, originCulture culture.Culture) (Region, error)

Generate generates a region

func Random

func Random() (Region, error)

Random generates a completely random region

func (Region) AssignTiles

func (region Region) AssignTiles(coordinates []geometry.Point) Region

AssignTiles gives a set of coordinates for tiles to a region

func (Region) Simplify

func (region Region) Simplify() (SimplifiedRegion, error)

Simplify returns a simplified version of a region

type SimplifiedRegion

type SimplifiedRegion struct {
	Name                 string                                `json:"name"`
	GeographyDescription string                                `json:"geography_description"`
	Capital              string                                `json:"capital"`
	DominantCulture      culture.Culture                       `json:"dominant_culture"`
	Ruler                character.SimplifiedCharacter         `json:"ruler"`
	RulingHouse          organization.SimplifiedOrganization   `json:"ruling_house"`
	Towns                []town.SimplifiedTown                 `json:"towns"`
	Organizations        []organization.SimplifiedOrganization `json:"organizations"`
}

SimplifiedRegion is a simplified version of a region

func RandomSimplified

func RandomSimplified() (SimplifiedRegion, error)

RandomSimplified generates a completely random region

Jump to

Keyboard shortcuts

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