fix(logic/service/fight): 修正状态效果判断逻辑中的类型转换问题
将 StatEffect_Exist 方法的参数类型从 int 改为 info.EnumPetStatus, 并在调用 GetEffect 时进行显式类型转换,以提高代码可读性和类型安全性。 同时清理了部分冗余的类型转换调用。
This commit is contained in:
@@ -84,8 +84,8 @@ func (our *Input) GetEffect(etype EnumEffectType, id int) Effect {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (our *Input) StatEffect_Exist(id int) bool {
|
||||
t := our.GetEffect(EffectType.Status, id)
|
||||
func (our *Input) StatEffect_Exist(id info.EnumPetStatus) bool {
|
||||
t := our.GetEffect(EffectType.Status, int(id))
|
||||
if t == nil {
|
||||
return false
|
||||
}
|
||||
@@ -102,6 +102,9 @@ func (our *Input) StatEffect_Exist_all() bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
func (our *Input) GetCurrAttr(id int) *model.PetInfo {
|
||||
|
||||
//todo 获取前GetEffect
|
||||
|
||||
Reference in New Issue
Block a user