basic item filter wip
This commit is contained in:
@@ -3,16 +3,20 @@ package item
|
||||
type Quality int
|
||||
|
||||
const (
|
||||
QualityNormal Quality = 0x02
|
||||
QualitySuperior Quality = 0x03
|
||||
QualityMagic Quality = 0x04
|
||||
QualitySet Quality = 0x05
|
||||
QualityRare Quality = 0x06
|
||||
QualityUnique Quality = 0x07
|
||||
QualityLowQuality Quality = 0x01
|
||||
QualityNormal Quality = 0x02
|
||||
QualitySuperior Quality = 0x03
|
||||
QualityMagic Quality = 0x04
|
||||
QualitySet Quality = 0x05
|
||||
QualityRare Quality = 0x06
|
||||
QualityUnique Quality = 0x07
|
||||
QualityCrafted Quality = 0x08
|
||||
)
|
||||
|
||||
func (q Quality) ToString() string {
|
||||
switch q {
|
||||
case QualityLowQuality:
|
||||
return "LowQuality"
|
||||
case QualityNormal:
|
||||
return "Normal"
|
||||
case QualitySuperior:
|
||||
|
||||
@@ -2,7 +2,7 @@ package item
|
||||
|
||||
import "strings"
|
||||
|
||||
var classMapping = map[string][]string{
|
||||
var typeMapping = map[string][]string{
|
||||
"Axes": {"HandAxe", "Axe", "DoubleAxe", "MilitaryPick", "WarAxe", "LargeAxe", "BroadAxe", "BattleAxe", "GreatAxe", "GiantAxe", "Hatchet", "Cleaver", "TwinAxe", "Crowbill", "Naga", "MilitaryAxe", "BeardedAxe", "Tabar", "GothicAxe", "AncientAxe", "Tomahawk", "SmallCrescent", "EttinAxe", "WarSpike", "BerserkerAxe", "FeralAxe", "SilverEdgedAxe", "Decapitator", "ChampionAxe", "GloriousAxe"},
|
||||
"Wands": {"Wand", "YewWand", "BoneWand", "GrimWand", "BurntWand", "PetrifiedWand", "TombWand", "GraveWand", "PolishedWand", "GhostWand", "LichWand", "UnearthedWand"},
|
||||
"Clubs": {"Club", "SpikedClub", "Cudgel", "BarbedClub", "Truncheon", "TyrantClub"},
|
||||
@@ -37,21 +37,11 @@ var classMapping = map[string][]string{
|
||||
"NecromancerShields": {"PreservedHead", "ZombieHead", "UnravellerHead", "GargoyleHead", "DemonHeadShield", "MummifiedTrophy", "FetishTrophy", "SextonTrophy", "CantorTrophy", "HierophantTrophy", "MinionSkull", "HellspawnSkull", "OverseerSkull", "SuccubusSkull", "BloodlordSkull"},
|
||||
}
|
||||
|
||||
func IsClass(itemClass string) bool {
|
||||
for class := range classMapping {
|
||||
if strings.EqualFold(itemClass, class) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func ClassForItemName(itemName string) (string, bool) {
|
||||
for class, itemNames := range classMapping {
|
||||
func TypeForItemName(itemName string) (string, bool) {
|
||||
for t, itemNames := range typeMapping {
|
||||
for _, name := range itemNames {
|
||||
if strings.EqualFold(itemName, name) {
|
||||
return class, true
|
||||
return t, true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user