refactor: 拆分战斗规则文件为独立模块
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
21
logic/service/fight/rule/rule_base.go
Normal file
21
logic/service/fight/rule/rule_base.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package rule
|
||||
|
||||
import (
|
||||
"blazing/logic/service/common"
|
||||
"blazing/modules/player/model"
|
||||
)
|
||||
|
||||
// RuleBase 规则基类:包含通用参数存储和基础方法
|
||||
type RuleBase struct {
|
||||
args []int // 通用参数存储,替代各个子类的 params
|
||||
}
|
||||
|
||||
// Exec 基类默认执行方法(子类可重写)
|
||||
func (r *RuleBase) Exec(f common.FightI, t *model.FightOverInfo) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// SetArgs 基类参数设置方法(所有子类继承使用)
|
||||
func (r *RuleBase) SetArgs(param ...int) {
|
||||
r.args = param
|
||||
}
|
||||
Reference in New Issue
Block a user