mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-06 19:44:15 -04:00
* Refactored animation mode enum * More d2enum changes * Refactored tile enum * Refactored weapon class enum * Refactored more enums * Refactored item event enum * Fixed init_functions animation mode * Removed string2enum from MonsterAnimationMode * Refactored ItemStatCost description * Last enum lint errors * Regenerated monster stringer file
41 lines
722 B
Go
41 lines
722 B
Go
// Code generated by "string2enum -samepkg -linecomment -type Hero"; DO NOT EDIT.
|
|
|
|
package d2enum
|
|
|
|
import "fmt"
|
|
|
|
// HeroFromString returns the Hero enum corresponding to s.
|
|
func HeroFromString(s string) Hero {
|
|
if len(s) == 0 {
|
|
return 0
|
|
}
|
|
for i := range _Hero_index[:len(_Hero_index)-1] {
|
|
if s == _Hero_name[_Hero_index[i]:_Hero_index[i+1]] {
|
|
return Hero(i)
|
|
}
|
|
}
|
|
panic(fmt.Errorf("unable to locate Hero enum corresponding to %q", s))
|
|
}
|
|
|
|
func _(s string) {
|
|
// Check for duplicate string values in type "Hero".
|
|
switch s {
|
|
// 0
|
|
case "":
|
|
// 1
|
|
case "Barbarian":
|
|
// 2
|
|
case "Necromancer":
|
|
// 3
|
|
case "Paladin":
|
|
// 4
|
|
case "Assassin":
|
|
// 5
|
|
case "Sorceress":
|
|
// 6
|
|
case "Amazon":
|
|
// 7
|
|
case "Druid":
|
|
}
|
|
}
|