NIP parser v2 (#17)

This commit is contained in:
Héctor Giménez
2024-05-05 12:15:08 +09:00
committed by GitHub
parent 0d5c108721
commit bb0ec2555d
28 changed files with 56618 additions and 1385 deletions

View File

@@ -1,5 +1,7 @@
package item
import "strings"
const (
ScrollOfTownPortal = "ScrollOfTownPortal"
ScrollOfIdentify = "ScrollOfIdentify"
@@ -9,12 +11,22 @@ const (
)
func GetNameByEnum(itemNumber uint) Name {
return Name(available[itemNumber])
return Name(Names[itemNumber])
}
func GetIDByName(itemName string) int {
for i, name := range Names {
if strings.EqualFold(name, itemName) {
return i
}
}
return -1
}
type Name string
var available = []string{
var Names = []string{
"HandAxe",
"Axe",
"DoubleAxe",