econ

package
v0.0.0-...-382259f Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Overview

Package econ provides economy-related structs and functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Money

type Money int64

Money represents a coinage state in the in-game economy. You cannot have negative money in-game, but you can set money as negative in order to subtract from a balance by addition.

const (
	Copper Money = 1
	Silver Money = 100 * Copper
	Gold   Money = 100 * Silver
)

func ParseMoney

func ParseMoney(in string) (Money, error)

func ParseShortString

func ParseShortString(input string) (Money, error)

func (Money) Coins

func (mn Money) Coins() []int64

func (Money) Int32

func (m Money) Int32() int32

func (Money) ShortString

func (m Money) ShortString() string

func (Money) String

func (m Money) String() string

Jump to

Keyboard shortcuts

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