Documentation ¶
Index ¶
- Variables
- type Calculator
- type CalculatorRegistry
- type ConversionRegistry
- type Converter
- type Float
- type ID
- type Incrementor
- type Iterator
- type Prop
- type PropValue
- type Type
- func (t Type) Alias(name string) *Type
- func (t Type) AsListOf(listOf *Type) *Type
- func (t *Type) AsMapOf(mapOf *Type) *Type
- func (t Type) Copy() *Type
- func (t Type) ID() ID
- func (t Type) Key() *Type
- func (t Type) Name() string
- func (t Type) Props() []Prop
- func (t Type) Value() *Type
- func (t Type) WithProps(props []Prop) *Type
- func (t Type) WithSelfProps(props func(self *Type) []Prop) *Type
- type Value
- type Vector3D
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Converters = ConversionRegistry{ // contains filtered or unexported fields } Calculators = CalculatorRegistry{} )
View Source
var ( TypeFloat = NewType("float") TypeInteger = NewType("integer") TypeBoolean = NewType("boolean") TypeMap = NewType("map").WithProps([]Prop{ {name: "size", t: TypeInteger}, }) TypeList = NewType("list").WithProps([]Prop{ {name: "size", t: TypeInteger}, }) TypePoint2D = NewType("point2d").WithProps([]Prop{ {name: "x", t: TypeFloat}, {name: "y", t: TypeFloat}, }) TypePoint3D = NewType("point3d").WithProps([]Prop{ {name: "x", t: TypeFloat}, {name: "y", t: TypeFloat}, {name: "z", t: TypeFloat}, }) TypeScale2D = TypePoint2D.Alias("scale2d") TypeScale3D = TypePoint3D.Alias("scale3d") TypeVector2D = NewType("vector2d").WithProps([]Prop{ {name: "x", t: TypeFloat}, {name: "y", t: TypeFloat}, {name: "length", t: TypeFloat}, }) TypeVector3D = NewType("vector3d").WithProps([]Prop{ {name: "x", t: TypeFloat}, {name: "y", t: TypeFloat}, {name: "z", t: TypeFloat}, {name: "length", t: TypeFloat}, }) TypeAngle = NewType("angle").WithProps([]Prop{ {name: "radians", t: TypeFloat}, {name: "degrees", t: TypeFloat}, }) TypeQuaternion = NewType("quaternion").WithProps([]Prop{ {name: "v", t: TypeVector3D}, {name: "t", t: TypeAngle}, }) TypeSprite = NewType("sprite").WithProps([]Prop{ {name: "angle", t: TypeAngle}, {name: "position", t: TypePoint2D}, {name: "alignment", t: TypePoint2D}, {name: "size", t: TypePoint2D}, {name: "scale", t: TypeScale2D}, }) TypeBone = NewType("bone").WithSelfProps(func(bone *Type) []Prop { return []Prop{ {name: "offset", t: TypeVector3D}, {name: "rotation", t: TypeQuaternion}, {name: "children", t: TypeMap.AsMapOf(bone)}, } }) TypeSkeleton = NewType("skeleton").WithProps([]Prop{ {name: "bones", t: TypeMap.AsMapOf(TypeBone)}, }) TypeMesh = NewType("mesh").WithProps([]Prop{ {name: "position", t: TypePoint3D}, {name: "rotation", t: TypeQuaternion}, {name: "scale", t: TypeScale3D}, {name: "skeleton", t: TypeSkeleton}, }) )
Functions ¶
This section is empty.
Types ¶
type Calculator ¶
type CalculatorRegistry ¶
type CalculatorRegistry map[ID]Calculator
func (CalculatorRegistry) Get ¶
func (r CalculatorRegistry) Get(t *Type) Calculator
func (CalculatorRegistry) Set ¶
func (r CalculatorRegistry) Set(t *Type, c Calculator)
type ConversionRegistry ¶
type ConversionRegistry struct {
// contains filtered or unexported fields
}
type Incrementor ¶
type Incrementor[V constraints.Ordered] struct { // contains filtered or unexported fields }
func NewIncrementor ¶
func NewIncrementor[V constraints.Ordered](start V, increment V) Incrementor[V]
func (Incrementor[V]) Get ¶
func (i Incrementor[V]) Get() V
type Iterator ¶
type Iterator[K comparable, V any] interface { Next() bool Get() V Set(value V) Key() K Remove() Reset() }
func IterateMap ¶
func IterateMap[K comparable, V any](m map[K]V) Iterator[K, V]
func IterateSlice ¶
Click to show internal directories.
Click to hide internal directories.