-
Notifications
You must be signed in to change notification settings - Fork 71
/
enumgen.go
87 lines (57 loc) · 4.05 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Code generated by "core generate"; DO NOT EDIT.
package plots
import (
"cogentcore.org/core/enums"
)
var _StepKindValues = []StepKind{0, 1, 2, 3}
// StepKindN is the highest valid value for type StepKind, plus one.
const StepKindN StepKind = 4
var _StepKindValueMap = map[string]StepKind{`NoStep`: 0, `PreStep`: 1, `MidStep`: 2, `PostStep`: 3}
var _StepKindDescMap = map[StepKind]string{0: `NoStep connects two points by simple line`, 1: `PreStep connects two points by following lines: vertical, horizontal.`, 2: `MidStep connects two points by following lines: horizontal, vertical, horizontal. Vertical line is placed in the middle of the interval.`, 3: `PostStep connects two points by following lines: horizontal, vertical.`}
var _StepKindMap = map[StepKind]string{0: `NoStep`, 1: `PreStep`, 2: `MidStep`, 3: `PostStep`}
// String returns the string representation of this StepKind value.
func (i StepKind) String() string { return enums.String(i, _StepKindMap) }
// SetString sets the StepKind value from its string representation,
// and returns an error if the string is invalid.
func (i *StepKind) SetString(s string) error {
return enums.SetString(i, s, _StepKindValueMap, "StepKind")
}
// Int64 returns the StepKind value as an int64.
func (i StepKind) Int64() int64 { return int64(i) }
// SetInt64 sets the StepKind value from an int64.
func (i *StepKind) SetInt64(in int64) { *i = StepKind(in) }
// Desc returns the description of the StepKind value.
func (i StepKind) Desc() string { return enums.Desc(i, _StepKindDescMap) }
// StepKindValues returns all possible values for the type StepKind.
func StepKindValues() []StepKind { return _StepKindValues }
// Values returns all possible values for the type StepKind.
func (i StepKind) Values() []enums.Enum { return enums.Values(_StepKindValues) }
// MarshalText implements the [encoding.TextMarshaler] interface.
func (i StepKind) MarshalText() ([]byte, error) { return []byte(i.String()), nil }
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
func (i *StepKind) UnmarshalText(text []byte) error { return enums.UnmarshalText(i, text, "StepKind") }
var _ShapesValues = []Shapes{0, 1, 2, 3, 4, 5, 6, 7}
// ShapesN is the highest valid value for type Shapes, plus one.
const ShapesN Shapes = 8
var _ShapesValueMap = map[string]Shapes{`Ring`: 0, `Circle`: 1, `Square`: 2, `Box`: 3, `Triangle`: 4, `Pyramid`: 5, `Plus`: 6, `Cross`: 7}
var _ShapesDescMap = map[Shapes]string{0: `Ring is the outline of a circle`, 1: `Circle is a solid circle`, 2: `Square is the outline of a square`, 3: `Box is a filled square`, 4: `Triangle is the outline of a triangle`, 5: `Pyramid is a filled triangle`, 6: `Plus is a plus sign`, 7: `Cross is a big X`}
var _ShapesMap = map[Shapes]string{0: `Ring`, 1: `Circle`, 2: `Square`, 3: `Box`, 4: `Triangle`, 5: `Pyramid`, 6: `Plus`, 7: `Cross`}
// String returns the string representation of this Shapes value.
func (i Shapes) String() string { return enums.String(i, _ShapesMap) }
// SetString sets the Shapes value from its string representation,
// and returns an error if the string is invalid.
func (i *Shapes) SetString(s string) error { return enums.SetString(i, s, _ShapesValueMap, "Shapes") }
// Int64 returns the Shapes value as an int64.
func (i Shapes) Int64() int64 { return int64(i) }
// SetInt64 sets the Shapes value from an int64.
func (i *Shapes) SetInt64(in int64) { *i = Shapes(in) }
// Desc returns the description of the Shapes value.
func (i Shapes) Desc() string { return enums.Desc(i, _ShapesDescMap) }
// ShapesValues returns all possible values for the type Shapes.
func ShapesValues() []Shapes { return _ShapesValues }
// Values returns all possible values for the type Shapes.
func (i Shapes) Values() []enums.Enum { return enums.Values(_ShapesValues) }
// MarshalText implements the [encoding.TextMarshaler] interface.
func (i Shapes) MarshalText() ([]byte, error) { return []byte(i.String()), nil }
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
func (i *Shapes) UnmarshalText(text []byte) error { return enums.UnmarshalText(i, text, "Shapes") }