blueprints

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindBuilding string = "building"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Blueprint

type Blueprint interface {
	Encode() ([]byte, error)
	Decode(src []byte) error
	Kind() string
	GetID() string
}

type Building

type Building struct {
	ID         uuid.UUID `json:"id"`
	Name       string    `json:"name"`
	Cost       map[string]int64
	Generates  map[string]Generator
	Transforms map[string]Transformer
	BuildTime  string
}

func (*Building) Decode

func (b *Building) Decode(src []byte) error

func (*Building) Encode

func (b *Building) Encode() ([]byte, error)

func (*Building) GetID

func (b *Building) GetID() string

func (*Building) Kind

func (b *Building) Kind() string

type Generator

type Generator struct {
	Name       string
	Amount     int
	TickLength string
}

type Transformer added in v0.2.0

type Transformer struct {
	Name       string
	Cost       []TransformerCost
	Result     []TransformerResult
	TickLength string
}

func (Transformer) CostStructList added in v0.2.0

func (t Transformer) CostStructList() *structpb.ListValue

func (Transformer) ResultStructList added in v0.2.0

func (t Transformer) ResultStructList() *structpb.ListValue

type TransformerCost added in v0.2.0

type TransformerCost struct {
	Resource  string
	Amount    int
	Temporary bool
}

type TransformerResult added in v0.2.0

type TransformerResult struct {
	Resource string
	Amount   int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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