/
enumgen.go
46 lines (30 loc) · 1.6 KB
/
enumgen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Code generated by "core generate"; DO NOT EDIT.
package math32
import (
"cogentcore.org/core/enums"
)
var _DimsValues = []Dims{0, 1, 2, 3}
// DimsN is the highest valid value for type Dims, plus one.
const DimsN Dims = 4
var _DimsValueMap = map[string]Dims{`X`: 0, `Y`: 1, `Z`: 2, `W`: 3}
var _DimsDescMap = map[Dims]string{0: ``, 1: ``, 2: ``, 3: ``}
var _DimsMap = map[Dims]string{0: `X`, 1: `Y`, 2: `Z`, 3: `W`}
// String returns the string representation of this Dims value.
func (i Dims) String() string { return enums.String(i, _DimsMap) }
// SetString sets the Dims value from its string representation,
// and returns an error if the string is invalid.
func (i *Dims) SetString(s string) error { return enums.SetString(i, s, _DimsValueMap, "Dims") }
// Int64 returns the Dims value as an int64.
func (i Dims) Int64() int64 { return int64(i) }
// SetInt64 sets the Dims value from an int64.
func (i *Dims) SetInt64(in int64) { *i = Dims(in) }
// Desc returns the description of the Dims value.
func (i Dims) Desc() string { return enums.Desc(i, _DimsDescMap) }
// DimsValues returns all possible values for the type Dims.
func DimsValues() []Dims { return _DimsValues }
// Values returns all possible values for the type Dims.
func (i Dims) Values() []enums.Enum { return enums.Values(_DimsValues) }
// MarshalText implements the [encoding.TextMarshaler] interface.
func (i Dims) MarshalText() ([]byte, error) { return []byte(i.String()), nil }
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
func (i *Dims) UnmarshalText(text []byte) error { return enums.UnmarshalText(i, text, "Dims") }