horsegen: generate races
This commit is contained in:
32
horsegen/race.go.template
Normal file
32
horsegen/race.go.template
Normal file
@@ -0,0 +1,32 @@
|
||||
{{- define "go-race" -}}
|
||||
package {{ $.Region }}
|
||||
|
||||
// Automatically generated with horsegen; DO NOT EDIT
|
||||
|
||||
import . "git.sunturtle.xyz/zephyr/horse/horse"
|
||||
|
||||
const (
|
||||
{{- range $r := $.Races }}
|
||||
Race{{ goenum $r.Name }}{{ if ne $r.Primary $r.ID }}Alternate{{ end }} RaceID = {{ $r.ID }} // {{ $r.Name }}
|
||||
{{- end }}
|
||||
)
|
||||
|
||||
var AllRaces = map[RaceID]Race{
|
||||
{{- range $r := $.Races }}
|
||||
Race{{ goenum $r.Name }}{{ if ne $r.Primary $r.ID }}Alternate{{ end }}: {
|
||||
ID: {{ $r.ID }},
|
||||
Name: {{ printf "%q" $r.Name }}{{ if ne $r.Primary $r.ID }} + " (Alternate)"{{ end }},
|
||||
Thumbnail: {{ $r.ThumbnailID }},
|
||||
{{- if ne $r.Primary $r.ID }}
|
||||
Primary: {{ $r.Primary }},
|
||||
{{- end }}
|
||||
},
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
var RaceNameToID = map[string]RaceID{
|
||||
{{- range $r := $.Races }}
|
||||
{{ printf "%q" $r.Name }}{{ if ne $r.Primary $r.ID }} + " (Alternate)"{{ end }}: {{ $r.ID }},
|
||||
{{- end }}
|
||||
}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user