``` refactor(player): 移除AI_player冗余方法并优化baseplayer结构
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user