refactor: 拆分战斗规则文件为独立模块
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-21 00:34:47 +08:00
committed by cnb
parent afc67b0582
commit 9a1a181ecd
20 changed files with 177 additions and 153 deletions

View 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
}