1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-06 18:27:20 -05:00
OpenDiablo2/d2common/d2enum/hero.go

42 lines
808 B
Go
Raw Normal View History

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 (h Hero) GetToken() string {
switch h {
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", h)
}
return ""
}
//go:generate stringer -linecomment -type Hero
//go:generate string2enum -samepkg -linecomment -type Hero