Documentation ¶
Index ¶
- Variables
- type Type
- func (enum Type) AltString() string
- func (enum Type) DetermineModifierWeightValueTypeFromString(s string) Value
- func (enum Type) EnsureValid() Type
- func (enum Type) ExtractFraction(s string) fxp.Fraction
- func (enum Type) Format(s string, defUnits fxp.WeightUnit) string
- func (enum Type) Key() string
- func (enum Type) MarshalText() (text []byte, err error)
- func (enum Type) Permitted() []Value
- func (enum Type) String() string
- func (enum Type) StringWithExample() string
- func (enum *Type) UnmarshalText(text []byte) error
- type Value
- func (enum Value) EnsureValid() Value
- func (enum Value) ExtractFraction(s string) fxp.Fraction
- func (enum Value) Format(fraction fxp.Fraction) string
- func (enum Value) FromString(s string) Value
- func (enum Value) Key() string
- func (enum Value) MarshalText() (text []byte, err error)
- func (enum Value) String() string
- func (enum *Value) UnmarshalText(text []byte) error
Constants ¶
This section is empty.
Variables ¶
Types holds all possible values.
var Values = []Value{ Addition, PercentageAdder, PercentageMultiplier, Multiplier, }
Values holds all possible values.
Functions ¶
This section is empty.
Types ¶
type Type ¶
type Type byte
Type describes how an Equipment Modifier's weight is applied.
func (Type) DetermineModifierWeightValueTypeFromString ¶
DetermineModifierWeightValueTypeFromString examines a string to determine what type it is, but restricts the result to those allowed for this Type.
func (Type) EnsureValid ¶
EnsureValid ensures this is of a known value.
func (Type) ExtractFraction ¶
ExtractFraction from the string.
func (Type) Format ¶
func (enum Type) Format(s string, defUnits fxp.WeightUnit) string
Format returns a formatted version of the value.
func (Type) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (Type) StringWithExample ¶
StringWithExample returns an example along with the normal String() content.
func (*Type) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Value ¶
type Value byte
Value describes how an Equipment Modifier's weight value is applied.
const LastValue Value = Multiplier
LastValue is the last valid value.
func ExtractValue ¶
ExtractValue extracts the value from a string.
func (Value) EnsureValid ¶
EnsureValid ensures this is of a known value.
func (Value) ExtractFraction ¶
ExtractFraction from the string.
func (Value) FromString ¶
FromString examines a string to determine what type it is.
func (Value) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Value) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.