Files
go-mc/data/entity/generator/entities.go.tmpl
2025-06-16 12:46:46 +08:00

23 lines
627 B
Cheetah

// Code generated by {{Generator}}; DO NOT EDIT.
package entity
type (
{{- range .}}
{{.Name | ToGoTypeName}} struct {}
{{- end}}
)
{{- range .}}
func ({{.Name | ToGoTypeName}}) ID() string { return {{.Name | printf "%q"}} }
func ({{.Name | ToGoTypeName}}) Width() float32 { return {{.Width | printf "%f"}} }
func ({{.Name | ToGoTypeName}}) Height() float32 { return {{.Height | printf "%f"}} }
{{- end}}
var FromID = map[string]Entity { {{- range .}}
{{.Name | printf "%q"}}: {{.Name | ToGoTypeName}}{},{{end}}
}
var ToID = map[ID]Entity { {{- range .}}
{{.Id | printf "%d"}}: {{.Name | ToGoTypeName}}{},{{end}}
}