go_dreamfactory/modules/rtask/condiFindHandle.go
2022-09-01 14:58:40 +08:00

32 lines
676 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 匹配类型和参数返回任务条件ID
package rtask
import cfg "go_dreamfactory/sys/configure/structs"
// 与每个参数比较
func (this *ModelRtaskRecord) equalParams(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32) {
var (
err error
paramLen int
)
if paramLen, err = verifyParam(cfg, vals...); err != nil {
return
}
if paramLen == 1 {
if vals[0] == cfg.Data1 {
condiId = cfg.Id
}
} else if paramLen == 2 {
if vals[0] == cfg.Data1 && vals[1] == cfg.Data2 {
condiId = cfg.Id
}
} else if paramLen == 3 {
if vals[0] == cfg.Data1 && vals[1] == cfg.Data2 && vals[2] == cfg.Data3 {
condiId = cfg.Id
}
}
return
}