refactor(controller): 重构控制器代码结构并优化战斗状态检查

- 添加包级注释说明controller包的功能和架构设计
- 重命名Controller结构体注释,使其更清晰明了
- 添加ParseCmd函数的
This commit is contained in:
2025-12-23 10:46:17 +08:00
parent 83ee9fba43
commit 9baca27033
11 changed files with 195 additions and 150 deletions

View File

@@ -11,7 +11,7 @@ import (
//大乱斗
func (h Controller) PET_MELEE(data *fight.StartPetWarInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
func (h Controller) PetMelee(data *fight.StartPetWarInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
c.Fightinfo.Mode = info.BattleMode.PET_MELEE
c.Fightinfo.Status = info.BattleMode.PET_MELEE
@@ -29,17 +29,12 @@ func (h Controller) PET_MELEE(data *fight.StartPetWarInboundInfo, c *player.Play
}
}) ///开始对战,房主方以及被邀请方
if err > 0 { //说明有报错
return false
}
return true
return err <= 0
})
return
}
func (h Controller) PET_King(data *fight.PetKingJoinInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
func (h Controller) PETKing(data *fight.PetKingJoinInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
c.Fightinfo.Status = info.BattleMode.PET_TOPLEVEL
@@ -60,11 +55,7 @@ func (h Controller) PET_King(data *fight.PetKingJoinInboundInfo, c *player.Playe
}
}) ///开始对战,房主方以及被邀请方
if err > 0 { //说明有报错
return false
}
return true
return err <= 0
})
return