mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-29 22:56:07 -04:00
d2enum: move compositeType.Name method int composite_type.go; lintfix
This commit is contained in:
parent
00bd2c52a0
commit
a662bbaeb4
@ -1,5 +1,9 @@
|
||||
package d2enum
|
||||
|
||||
const (
|
||||
unknown = "Unknown"
|
||||
)
|
||||
|
||||
//go:generate stringer -linecomment -type CompositeType -output composite_type_string.go
|
||||
|
||||
// CompositeType represents a composite type
|
||||
@ -25,3 +29,32 @@ const (
|
||||
CompositeTypeSpecial8 // S8
|
||||
CompositeTypeMax
|
||||
)
|
||||
|
||||
// Name returns a full name of layer
|
||||
func (i CompositeType) Name() string {
|
||||
strings := map[CompositeType]string{
|
||||
CompositeTypeHead: "Head",
|
||||
CompositeTypeTorso: "Torso",
|
||||
CompositeTypeLegs: "Legs",
|
||||
CompositeTypeRightArm: "Right Arm",
|
||||
CompositeTypeLeftArm: "Left Arm",
|
||||
CompositeTypeRightHand: "Right Hand",
|
||||
CompositeTypeLeftHand: "Left Hand",
|
||||
CompositeTypeShield: "Shield",
|
||||
CompositeTypeSpecial1: "Special 1",
|
||||
CompositeTypeSpecial2: "Special 2",
|
||||
CompositeTypeSpecial3: "Special 3",
|
||||
CompositeTypeSpecial4: "Special 4",
|
||||
CompositeTypeSpecial5: "Special 5",
|
||||
CompositeTypeSpecial6: "Special 6",
|
||||
CompositeTypeSpecial7: "Special 7",
|
||||
CompositeTypeSpecial8: "Special 8",
|
||||
}
|
||||
|
||||
layerName, found := strings[i]
|
||||
if !found {
|
||||
return unknown
|
||||
}
|
||||
|
||||
return layerName
|
||||
}
|
||||
|
@ -37,33 +37,3 @@ func (i CompositeType) String() string {
|
||||
}
|
||||
return _CompositeType_name[_CompositeType_index[i]:_CompositeType_index[i+1]]
|
||||
}
|
||||
|
||||
// Name returns a full name of layer
|
||||
func (i CompositeType) Name() string {
|
||||
strings := map[CompositeType]string{
|
||||
CompositeTypeHead: "Head",
|
||||
CompositeTypeTorso: "Torso",
|
||||
CompositeTypeLegs: "Legs",
|
||||
CompositeTypeRightArm: "Right Arm",
|
||||
CompositeTypeLeftArm: "Left Arm",
|
||||
CompositeTypeRightHand: "Right Hand",
|
||||
CompositeTypeLeftHand: "Left Hand",
|
||||
CompositeTypeShield: "Shield",
|
||||
CompositeTypeSpecial1: "Special 1",
|
||||
CompositeTypeSpecial2: "Special 2",
|
||||
CompositeTypeSpecial3: "Special 3",
|
||||
CompositeTypeSpecial4: "Special 4",
|
||||
CompositeTypeSpecial5: "Special 5",
|
||||
CompositeTypeSpecial6: "Special 6",
|
||||
CompositeTypeSpecial7: "Special 7",
|
||||
CompositeTypeSpecial8: "Special 8",
|
||||
}
|
||||
|
||||
layerName, found := strings[i]
|
||||
if !found {
|
||||
return "Unknown"
|
||||
}
|
||||
|
||||
return layerName
|
||||
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func (d DrawEffect) String() string {
|
||||
|
||||
drawEffect, found := strings[d]
|
||||
if !found {
|
||||
return "Unknown"
|
||||
return unknown
|
||||
}
|
||||
|
||||
return drawEffect
|
||||
|
@ -46,7 +46,7 @@ func (w WeaponClass) Name() string {
|
||||
|
||||
weaponClass, found := strings[w]
|
||||
if !found {
|
||||
return "Unknown"
|
||||
return unknown
|
||||
}
|
||||
|
||||
return weaponClass
|
||||
|
Loading…
Reference in New Issue
Block a user