mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-10-31 16:27:18 -04:00
42 lines
808 B
Go
42 lines
808 B
Go
|
package d2enum
|
||
|
|
||
|
import "log"
|
||
|
|
||
|
type Hero int
|
||
|
|
||
|
const (
|
||
|
HeroNone Hero = 0 //
|
||
|
HeroBarbarian Hero = 1 // Barbarian
|
||
|
HeroNecromancer Hero = 2 // Necromancer
|
||
|
HeroPaladin Hero = 3 // Paladin
|
||
|
HeroAssassin Hero = 4 // Assassin
|
||
|
HeroSorceress Hero = 5 // Sorceress
|
||
|
HeroAmazon Hero = 6 // Amazon
|
||
|
HeroDruid Hero = 7 // Druid
|
||
|
)
|
||
|
|
||
|
func (v Hero) GetToken() string {
|
||
|
switch v {
|
||
|
case HeroBarbarian:
|
||
|
return "BA"
|
||
|
case HeroNecromancer:
|
||
|
return "NE"
|
||
|
case HeroPaladin:
|
||
|
return "PA"
|
||
|
case HeroAssassin:
|
||
|
return "AI"
|
||
|
case HeroSorceress:
|
||
|
return "SO"
|
||
|
case HeroAmazon:
|
||
|
return "AM"
|
||
|
case HeroDruid:
|
||
|
return "DZ"
|
||
|
default:
|
||
|
log.Fatalf("Unknown hero token: %d", v)
|
||
|
}
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
//go:generate stringer -linecomment -type Hero
|
||
|
//go:generate string2enum -samepkg -linecomment -type Hero
|