equipment

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AllModifierCostType holds all possible values.
	AllModifierCostType = []ModifierCostType{
		OriginalCost,
		BaseCost,
		FinalBaseCost,
		FinalCost,
	}
)
View Source
var (
	// AllModifierCostValueType holds all possible values.
	AllModifierCostValueType = []ModifierCostValueType{
		Addition,
		Percentage,
		Multiplier,
		CostFactor,
	}
)
View Source
var (
	// AllModifierWeightType holds all possible values.
	AllModifierWeightType = []ModifierWeightType{
		OriginalWeight,
		BaseWeight,
		FinalBaseWeight,
		FinalWeight,
	}
)
View Source
var (
	// AllModifierWeightValueType holds all possible values.
	AllModifierWeightValueType = []ModifierWeightValueType{
		WeightAddition,
		WeightPercentageAdder,
		WeightPercentageMultiplier,
		WeightMultiplier,
	}
)

Functions

This section is empty.

Types

type ModifierCostType

type ModifierCostType byte

ModifierCostType describes how an EquipmentModifier's cost is applied.

const (
	OriginalCost ModifierCostType = iota
	BaseCost
	FinalBaseCost
	FinalCost
	LastModifierCostType = FinalCost
)

Possible values.

func ExtractModifierCostType

func ExtractModifierCostType(str string) ModifierCostType

ExtractModifierCostType extracts the value from a string.

func (ModifierCostType) AltString

func (enum ModifierCostType) AltString() string

AltString returns the alternate string.

func (ModifierCostType) DetermineModifierCostValueTypeFromString

func (enum ModifierCostType) DetermineModifierCostValueTypeFromString(s string) ModifierCostValueType

DetermineModifierCostValueTypeFromString examines a string to determine what type it is, but restricts the result to those allowed for this ModifierCostType.

func (ModifierCostType) EnsureValid

func (enum ModifierCostType) EnsureValid() ModifierCostType

EnsureValid ensures this is of a known value.

func (ModifierCostType) ExtractValue

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

ExtractValue from the string.

func (ModifierCostType) Format

func (enum ModifierCostType) Format(s string) string

Format returns a formatted version of the value.

func (ModifierCostType) Key

func (enum ModifierCostType) Key() string

Key returns the key used in serialization.

func (ModifierCostType) MarshalText

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

MarshalText implements the encoding.TextMarshaler interface.

func (ModifierCostType) Permitted

func (enum ModifierCostType) Permitted() []ModifierCostValueType

Permitted returns the permitted ModifierCostValueType values.

func (ModifierCostType) String

func (enum ModifierCostType) String() string

String implements fmt.Stringer.

func (ModifierCostType) StringWithExample

func (enum ModifierCostType) StringWithExample() string

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

func (*ModifierCostType) UnmarshalText

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

UnmarshalText implements the encoding.TextUnmarshaler interface.

type ModifierCostValueType

type ModifierCostValueType byte

ModifierCostValueType describes how an EquipmentModifier's cost is applied.

const (
	Addition ModifierCostValueType = iota
	Percentage
	Multiplier
	CostFactor
	LastModifierCostValueType = CostFactor
)

Possible values.

func DetermineModifierCostValueTypeFromString

func DetermineModifierCostValueTypeFromString(s string) ModifierCostValueType

DetermineModifierCostValueTypeFromString examines a string to determine what type it is.

func ExtractModifierCostValueType

func ExtractModifierCostValueType(str string) ModifierCostValueType

ExtractModifierCostValueType extracts the value from a string.

func (ModifierCostValueType) EnsureValid

func (enum ModifierCostValueType) EnsureValid() ModifierCostValueType

EnsureValid ensures this is of a known value.

func (ModifierCostValueType) ExtractValue

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

ExtractValue from the string.

func (ModifierCostValueType) Format

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

Format returns a formatted version of the value.

func (ModifierCostValueType) Key

func (enum ModifierCostValueType) Key() string

Key returns the key used in serialization.

func (ModifierCostValueType) MarshalText

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

MarshalText implements the encoding.TextMarshaler interface.

func (ModifierCostValueType) String

func (enum ModifierCostValueType) String() string

String implements fmt.Stringer.

func (*ModifierCostValueType) UnmarshalText

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

UnmarshalText implements the encoding.TextUnmarshaler interface.

type ModifierWeightType

type ModifierWeightType byte

ModifierWeightType describes how an EquipmentModifier's weight is applied.

const (
	OriginalWeight ModifierWeightType = iota
	BaseWeight
	FinalBaseWeight
	FinalWeight
	LastModifierWeightType = FinalWeight
)

Possible values.

func ExtractModifierWeightType

func ExtractModifierWeightType(str string) ModifierWeightType

ExtractModifierWeightType extracts the value from a string.

func (ModifierWeightType) AltString

func (enum ModifierWeightType) AltString() string

AltString returns the alternate string.

func (ModifierWeightType) DetermineModifierWeightValueTypeFromString

func (enum ModifierWeightType) DetermineModifierWeightValueTypeFromString(s string) ModifierWeightValueType

DetermineModifierWeightValueTypeFromString examines a string to determine what type it is, but restricts the result to those allowed for this ModifierWeightType.

func (ModifierWeightType) EnsureValid

func (enum ModifierWeightType) EnsureValid() ModifierWeightType

EnsureValid ensures this is of a known value.

func (ModifierWeightType) ExtractFraction

func (enum ModifierWeightType) ExtractFraction(s string) fxp.Fraction

ExtractFraction from the string.

func (ModifierWeightType) Format

func (enum ModifierWeightType) Format(s string, defUnits measure.WeightUnits) string

Format returns a formatted version of the value.

func (ModifierWeightType) Key

func (enum ModifierWeightType) Key() string

Key returns the key used in serialization.

func (ModifierWeightType) MarshalText

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

MarshalText implements the encoding.TextMarshaler interface.

func (ModifierWeightType) Permitted

func (enum ModifierWeightType) Permitted() []ModifierWeightValueType

Permitted returns the permitted ModifierCostValueType values.

func (ModifierWeightType) String

func (enum ModifierWeightType) String() string

String implements fmt.Stringer.

func (ModifierWeightType) StringWithExample

func (enum ModifierWeightType) StringWithExample() string

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

func (*ModifierWeightType) UnmarshalText

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

UnmarshalText implements the encoding.TextUnmarshaler interface.

type ModifierWeightValueType

type ModifierWeightValueType byte

ModifierWeightValueType describes how an EquipmentModifier's weight is applied.

const (
	WeightAddition ModifierWeightValueType = iota
	WeightPercentageAdder
	WeightPercentageMultiplier
	WeightMultiplier
	LastModifierWeightValueType = WeightMultiplier
)

Possible values.

func DetermineModifierWeightValueTypeFromString

func DetermineModifierWeightValueTypeFromString(s string) ModifierWeightValueType

DetermineModifierWeightValueTypeFromString examines a string to determine what type it is.

func ExtractModifierWeightValueType

func ExtractModifierWeightValueType(str string) ModifierWeightValueType

ExtractModifierWeightValueType extracts the value from a string.

func (ModifierWeightValueType) EnsureValid

EnsureValid ensures this is of a known value.

func (ModifierWeightValueType) ExtractFraction

func (enum ModifierWeightValueType) ExtractFraction(s string) fxp.Fraction

ExtractFraction from the string.

func (ModifierWeightValueType) Format

func (enum ModifierWeightValueType) Format(fraction fxp.Fraction) string

Format returns a formatted version of the value.

func (ModifierWeightValueType) Key

func (enum ModifierWeightValueType) Key() string

Key returns the key used in serialization.

func (ModifierWeightValueType) MarshalText

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

MarshalText implements the encoding.TextMarshaler interface.

func (ModifierWeightValueType) String

func (enum ModifierWeightValueType) String() string

String implements fmt.Stringer.

func (*ModifierWeightValueType) UnmarshalText

func (enum *ModifierWeightValueType) 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