-
Notifications
You must be signed in to change notification settings - Fork 0
/
respawntype_gen.go
47 lines (37 loc) · 1.21 KB
/
respawntype_gen.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
// Code generated by "genenum.exe -typename=RespawnType -packagename=respawntype -basedir=enum"
package respawntype
import "fmt"
type RespawnType uint8
const (
ToHomeFloor RespawnType = iota // respawn to home floor
ToCurrentFloor // respawn to current floor
ToRandomFloor // respawn to random floor in tower
//
RespawnType_Count int = iota
)
var _RespawnType2string = [RespawnType_Count][2]string{
ToHomeFloor: {"ToHomeFloor", "respawn to home floor"},
ToCurrentFloor: {"ToCurrentFloor", "respawn to current floor"},
ToRandomFloor: {"ToRandomFloor", "respawn to random floor in tower"},
}
func (e RespawnType) String() string {
if e >= 0 && e < RespawnType(RespawnType_Count) {
return _RespawnType2string[e][0]
}
return fmt.Sprintf("RespawnType%d", uint8(e))
}
func (e RespawnType) CommentString() string {
if e >= 0 && e < RespawnType(RespawnType_Count) {
return _RespawnType2string[e][1]
}
return ""
}
var _string2RespawnType = map[string]RespawnType{
"ToHomeFloor": ToHomeFloor,
"ToCurrentFloor": ToCurrentFloor,
"ToRandomFloor": ToRandomFloor,
}
func String2RespawnType(s string) (RespawnType, bool) {
v, b := _string2RespawnType[s]
return v, b
}