mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-15 16:56:00 -05:00
9e58b134e5
* 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
55 lines
953 B
Go
55 lines
953 B
Go
// Code generated by "string2enum -samepkg -linecomment -type WeaponClass -output weapon_class_string2enum.go"; DO NOT EDIT.
|
|
|
|
package d2enum
|
|
|
|
import "fmt"
|
|
|
|
// WeaponClassFromString returns the WeaponClass enum corresponding to s.
|
|
func WeaponClassFromString(s string) WeaponClass {
|
|
if len(s) == 0 {
|
|
return 0
|
|
}
|
|
for i := range _WeaponClass_index[:len(_WeaponClass_index)-1] {
|
|
if s == _WeaponClass_name[_WeaponClass_index[i]:_WeaponClass_index[i+1]] {
|
|
return WeaponClass(i)
|
|
}
|
|
}
|
|
panic(fmt.Errorf("unable to locate WeaponClass enum corresponding to %q", s))
|
|
}
|
|
|
|
func _(s string) {
|
|
// Check for duplicate string values in type "WeaponClass".
|
|
switch s {
|
|
// 0
|
|
case "":
|
|
// 1
|
|
case "hth":
|
|
// 2
|
|
case "bow":
|
|
// 3
|
|
case "1hs":
|
|
// 4
|
|
case "1ht":
|
|
// 5
|
|
case "stf":
|
|
// 6
|
|
case "2hs":
|
|
// 7
|
|
case "2ht":
|
|
// 8
|
|
case "xbw":
|
|
// 9
|
|
case "1js":
|
|
// 10
|
|
case "1jt":
|
|
// 11
|
|
case "1ss":
|
|
// 12
|
|
case "1st":
|
|
// 13
|
|
case "ht1":
|
|
// 14
|
|
case "ht2":
|
|
}
|
|
}
|