``` refactor(player): 移除AI_player冗余方法并优化baseplayer结构

This commit is contained in:
1
2025-12-29 14:26:46 +00:00
parent 214bf4ce93
commit 1e9176c4ae
2 changed files with 13 additions and 12 deletions

View File

@@ -1,7 +1,6 @@
package player
import (
"blazing/logic/service/common"
"blazing/logic/service/fight/info"
"blazing/modules/blazing/model"
)
@@ -34,12 +33,6 @@ func (p *AI_player) GetPetInfo() []model.PetInfo {
func (lw *AI_player) SendLoadPercent(info.LoadPercentOutboundInfo) {
}
func (f *AI_player) InvitePlayer(ff common.PlayerI) {
}
func (p *AI_player) QuitFight() {
}
func (p *AI_player) CanFight() bool {

View File

@@ -12,6 +12,7 @@ import (
)
type baseplayer struct {
//Fightinfo info.Fightinfo
Info *model.PlayerInfo
//canFight uint32
FightC common.FightI //绑定战斗标识 替代本身的是否战斗标记 //IsFighting bool
@@ -23,11 +24,11 @@ func newbaseplayer() baseplayer {
rng := rand.New(rand.NewSource(time.Now().UnixNano() + int64(grand.Intn(1000000))))
ret := baseplayer{}
ret.PlayerCaptureContext = &info.PlayerCaptureContext{
rng,
1000,
0.10, // 15%衰减率
1,
make(map[int]int),
Random: rng,
Denominator: 1000,
DecayFactor: 0.10, // 15%衰减率
MinDecayNum: 1,
Guarantees: make(map[int]int),
}
return ret
}
@@ -37,6 +38,13 @@ func (p *baseplayer) GetInfo() *model.PlayerInfo {
return p.Info
}
func (f *baseplayer) InvitePlayer(ff common.PlayerI) {
}
func (p *baseplayer) QuitFight() {
}
// SetFightC 设置玩家战斗控制器
func (f *baseplayer) SetFightC(fightController common.FightI) {
f.FightC = fightController