emcost

package
v5.20.4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Types = []Type{
	Original,
	Base,
	FinalBase,
	Final,
}

Types holds all possible values.

Values holds all possible values.

Functions

This section is empty.

Types

type Type

type Type byte

Type describes how an Equipment Modifier's cost is applied.

const (
	Original Type = iota
	Base
	FinalBase
	Final
)

Possible values.

const LastType Type = Final

LastType is the last valid value.

func ExtractType

func ExtractType(str string) Type

ExtractType extracts the value from a string.

func (Type) AltString

func (enum Type) AltString() string

AltString returns the alternate string.

func (Type) EnsureValid

func (enum Type) EnsureValid() Type

EnsureValid ensures this is of a known value.

func (Type) ExtractValue

func (enum Type) ExtractValue(s string) fxp.Int

ExtractValue from the string.

func (Type) Format

func (enum Type) Format(s string) string

Format returns a formatted version of the value.

func (Type) FromString

func (enum Type) FromString(s string) Value

FromString examines a string to determine what Value it is, but restricts the result to those allowed for this Type.

func (Type) Key

func (enum Type) Key() string

Key returns the key used in serialization.

func (Type) MarshalText

func (enum Type) MarshalText() (text []byte, err error)

MarshalText implements the encoding.TextMarshaler interface.

func (Type) Permitted

func (enum Type) Permitted() []Value

Permitted returns the permitted values.

func (Type) String

func (enum Type) String() string

String implements fmt.Stringer.

func (Type) StringWithExample

func (enum Type) StringWithExample() string

StringWithExample returns an example along with the normal String() content.

func (*Type) UnmarshalText

func (enum *Type) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type Value

type Value byte

Value describes how an Equipment Modifier's cost value is applied.

const (
	Addition Value = iota
	Percentage
	Multiplier
	CostFactor
)

Possible values.

const LastValue Value = CostFactor

LastValue is the last valid value.

func ExtractValue

func ExtractValue(str string) Value

ExtractValue extracts the value from a string.

func (Value) EnsureValid

func (enum Value) EnsureValid() Value

EnsureValid ensures this is of a known value.

func (Value) ExtractValue

func (enum Value) ExtractValue(s string) fxp.Int

ExtractValue from the string.

func (Value) Format

func (enum Value) Format(value fxp.Int) string

Format returns a formatted version of the value.

func (Value) FromString

func (enum Value) FromString(s string) Value

FromString examines a string to determine what type it is.

func (Value) Key

func (enum Value) Key() string

Key returns the key used in serialization.

func (Value) MarshalText

func (enum Value) MarshalText() (text []byte, err error)

MarshalText implements the encoding.TextMarshaler interface.

func (Value) String

func (enum Value) String() string

String implements fmt.Stringer.

func (*Value) UnmarshalText

func (enum *Value) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

Jump to

Keyboard shortcuts

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