refactor(logic): 重构逻辑层代码
- 移除未使用的 SocketHandler_Tomee.go、ai.go、effect_1.go 文件 - 更新 player 包名引用,替换原 service 包 - 调整 TomeeHeader 和相关处理逻辑至 player 包 - 更新各控制器中的 Player 引用为 player 包中的类型 - 移除冗余的 GetPlayer 方法,使用新逻辑
This commit is contained in:
44
logic/service/fight/input/input.go
Normal file
44
logic/service/fight/input/input.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package input
|
||||
|
||||
import (
|
||||
"blazing/logic/service/common"
|
||||
"blazing/logic/service/fight/info"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type Input struct {
|
||||
CanChange bool //是否可以死亡切换CanChange
|
||||
CurrentPet *info.BattlePetEntity //当前精灵
|
||||
AllPet []*info.BattlePetEntity
|
||||
Player common.PlayerI
|
||||
Finished bool //是否加载完成
|
||||
*info.AttackValue
|
||||
FightC common.FightI
|
||||
// info.BattleActionI
|
||||
Damage decimal.Decimal //造成伤害
|
||||
}
|
||||
|
||||
func (i *Input) GetPetInfo() *info.BattlePetEntity {
|
||||
|
||||
return i.CurrentPet
|
||||
|
||||
}
|
||||
func (i *Input) InitAttackValue() {
|
||||
i.AttackValue = info.NewAttackValue(i.Player.ID())
|
||||
|
||||
}
|
||||
func (i *Input) GetPet(id uint32) (ii *info.BattlePetEntity, Reason info.ChangePetInfo) {
|
||||
for _, v := range i.AllPet {
|
||||
if v.Info.CatchTime == uint32(id) {
|
||||
copier.Copy(&Reason, &v.Info)
|
||||
Reason.UserId = i.Player.ID()
|
||||
|
||||
ii = v
|
||||
}
|
||||
|
||||
}
|
||||
return
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user