mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-27 21:56:19 -04:00
d2enum: weapon class: Name method
This commit is contained in:
parent
36f356d0c3
commit
00bd2c52a0
@ -45,3 +45,24 @@ const (
|
|||||||
func (d DrawEffect) Transparent() bool {
|
func (d DrawEffect) Transparent() bool {
|
||||||
return d != DrawEffectNone
|
return d != DrawEffectNone
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d DrawEffect) String() string {
|
||||||
|
strings := map[DrawEffect]string{
|
||||||
|
DrawEffectPctTransparency25: "25% alpha",
|
||||||
|
DrawEffectPctTransparency50: "50% alpha",
|
||||||
|
DrawEffectPctTransparency75: "75% alpha",
|
||||||
|
DrawEffectModulate: "Modulate",
|
||||||
|
DrawEffectBurn: "Burn",
|
||||||
|
DrawEffectNormal: "Normal",
|
||||||
|
DrawEffectMod2XTrans: "Mod2XTrans",
|
||||||
|
DrawEffectMod2X: "Mod2X",
|
||||||
|
DrawEffectNone: "None",
|
||||||
|
}
|
||||||
|
|
||||||
|
drawEffect, found := strings[d]
|
||||||
|
if !found {
|
||||||
|
return "Unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
return drawEffect
|
||||||
|
}
|
||||||
|
@ -24,3 +24,30 @@ const (
|
|||||||
WeaponClassOneHandToHand // ht1
|
WeaponClassOneHandToHand // ht1
|
||||||
WeaponClassTwoHandToHand // ht2
|
WeaponClassTwoHandToHand // ht2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (w WeaponClass) Name() string {
|
||||||
|
strings := map[WeaponClass]string{
|
||||||
|
WeaponClassNone: "None",
|
||||||
|
WeaponClassHandToHand: "Hand To Hand",
|
||||||
|
WeaponClassBow: "Bow",
|
||||||
|
WeaponClassOneHandSwing: "One Hand Swing",
|
||||||
|
WeaponClassOneHandThrust: "One Hand Thrust",
|
||||||
|
WeaponClassStaff: "Staff",
|
||||||
|
WeaponClassTwoHandSwing: "Two Hand Swing",
|
||||||
|
WeaponClassTwoHandThrust: "Two Hand Thrust",
|
||||||
|
WeaponClassCrossbow: "Crossbow",
|
||||||
|
WeaponClassLeftJabRightSwing: "Left Jab Right Swing",
|
||||||
|
WeaponClassLeftJabRightThrust: "Left Jab Right Thrust",
|
||||||
|
WeaponClassLeftSwingRightSwing: "Left Swing Right Swing",
|
||||||
|
WeaponClassLeftSwingRightThrust: "Left Swing Right Thrust",
|
||||||
|
WeaponClassOneHandToHand: "One Hand To Hand",
|
||||||
|
WeaponClassTwoHandToHand: "Two Hand To Hand",
|
||||||
|
}
|
||||||
|
|
||||||
|
weaponClass, found := strings[w]
|
||||||
|
if !found {
|
||||||
|
return "Unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
return weaponClass
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user