heraldry

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: 11 Imported by: 0

Documentation

Overview

Package heraldry implements methods for randomly generating heraldic coats of arms and their associated blazons.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Blazon   string      `json:"blazon"`
	Field    field.Field `json:"field"`
	ImageURL string      `json:"image_url"`
	FileName string      `json:"file_name"`
	GUID     string      `json:"guid"`
}

Device is the entire coat of arms

func Generate

func Generate() (Device, error)

Generate procedurally generates a random heraldic device and returns it.

func GenerateByParameters

func GenerateByParameters(fieldName string, chargeTag string) (Device, error)

GenerateByParameters generates a random heraldic device fitting certain criteria.

func (Device) RenderToBlazon

func (device Device) RenderToBlazon() (string, error)

RenderToBlazon renders a device as its blazon and returns it.

func (Device) RenderToPNG

func (device Device) RenderToPNG() (string, error)

RenderToPNG renders a device as PNG and returns the image

func (Device) Simplify

func (device Device) Simplify() SimplifiedDevice

Simplify returns a simplified device

type SimplifiedDevice

type SimplifiedDevice struct {
	Blazon   string `json:"blazon"`
	ImageURL string `json:"image_url"`
}

SimplifiedDevice is a simplified version of an heraldic device meant for JSON display

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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