variables

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VariableTypeInt    VariableType = iota
	VariableTypeFloat               = iota
	VariableTypeString              = iota
)
View Source
const COLOR_MAX = 0xFFFFFF

Variables

View Source
var DEFAULT_VARIABLES = map[string]VariableConstraint{}/* 110 elements not displayed */

Functions

This section is empty.

Types

type FloatConstraint

type FloatConstraint struct {
	Min     float32
	Default float32
	Max     float32
}

func (FloatConstraint) Type

func (v FloatConstraint) Type() VariableType

type FloatVariable

type FloatVariable float32

func (FloatVariable) Type

func (v FloatVariable) Type() VariableType

type IntConstraint

type IntConstraint struct {
	Min     int32
	Default int32
	Max     int32
}

func (IntConstraint) Type

func (v IntConstraint) Type() VariableType

type IntVariable

type IntVariable int32

func (IntVariable) Type

func (v IntVariable) Type() VariableType

type StringConstraint

type StringConstraint struct {
	Default string
}

func (StringConstraint) Type

func (v StringConstraint) Type() VariableType

type StringVariable

type StringVariable string

func (StringVariable) Type

func (v StringVariable) Type() VariableType

type Variable

type Variable interface {
	Type() VariableType
}

type VariableConstraint

type VariableConstraint interface {
	Type() VariableType
}

Constrain variables to their range of valid values

type VariableType

type VariableType byte

type Variables

type Variables map[string]Variable

func (Variables) MarshalJSON

func (v Variables) MarshalJSON() ([]byte, error)

func (Variables) Set

func (v Variables) Set(name string, value Variable) error

func (Variables) SetFloat

func (v Variables) SetFloat(name string, value float32) error

func (Variables) SetInt

func (v Variables) SetInt(name string, value int32) error

func (Variables) SetString

func (v Variables) SetString(name string, value string) error

func (*Variables) UnmarshalJSON

func (v *Variables) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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