refactor: 重构入参类型引用
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -18,7 +18,7 @@ func (h Controller) checkFightStatus(c *player.Player) errorcode.ErrorCode {
|
||||
}
|
||||
|
||||
// OnReadyToFight 准备战斗
|
||||
func (h Controller) OnReadyToFight(data *fight.ReadyToFightInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) OnReadyToFight(data *ReadyToFightInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
if err := h.checkFightStatus(c); err != 0 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -27,7 +27,7 @@ func (h Controller) OnReadyToFight(data *fight.ReadyToFightInboundInfo, c *playe
|
||||
}
|
||||
|
||||
// UseSkill 使用技能包
|
||||
func (h Controller) UseSkill(data *fight.UseSkillInInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) UseSkill(data *UseSkillInInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
if err := h.checkFightStatus(c); err != 0 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -37,7 +37,7 @@ func (h Controller) UseSkill(data *fight.UseSkillInInfo, c *player.Player) (resu
|
||||
|
||||
// UseSkillAt 组队/多战位技能包(cmd=7505)。
|
||||
// 目标关系:0=对方 1=自己 2=队友。
|
||||
func (h Controller) UseSkillAt(data *fight.UseSkillAtInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) UseSkillAt(data *UseSkillAtInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
if err := h.checkFightStatus(c); err != 0 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -70,7 +70,7 @@ func (h Controller) UseSkillAt(data *fight.UseSkillAtInboundInfo, c *player.Play
|
||||
}
|
||||
|
||||
// Escape 战斗逃跑
|
||||
func (h Controller) Escape(data *fight.EscapeFightInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) Escape(data *EscapeFightInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
if err := h.checkFightStatus(c); err != 0 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -80,7 +80,7 @@ func (h Controller) Escape(data *fight.EscapeFightInboundInfo, c *player.Player)
|
||||
}
|
||||
|
||||
// ChangePet 切换精灵
|
||||
func (h Controller) ChangePet(data *fight.ChangePetInboundInfo, c *player.Player) (result *info.ChangePetInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) ChangePet(data *ChangePetInboundInfo, c *player.Player) (result *info.ChangePetInfo, err errorcode.ErrorCode) {
|
||||
if err := h.checkFightStatus(c); err != 0 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -89,7 +89,7 @@ func (h Controller) ChangePet(data *fight.ChangePetInboundInfo, c *player.Player
|
||||
}
|
||||
|
||||
// Capture 捕捉精灵
|
||||
func (h Controller) Capture(data *fight.CatchMonsterInboundInfo, c *player.Player) (result *info.CatchMonsterOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) Capture(data *CatchMonsterInboundInfo, c *player.Player) (result *info.CatchMonsterOutboundInfo, err errorcode.ErrorCode) {
|
||||
if err := h.checkFightStatus(c); err != 0 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -104,7 +104,7 @@ func (h Controller) Capture(data *fight.CatchMonsterInboundInfo, c *player.Playe
|
||||
}
|
||||
|
||||
// LoadPercent 加载进度
|
||||
func (h Controller) LoadPercent(data *fight.LoadPercentInboundInfo, c *player.Player) (result *info.LoadPercentOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) LoadPercent(data *LoadPercentInboundInfo, c *player.Player) (result *info.LoadPercentOutboundInfo, err errorcode.ErrorCode) {
|
||||
if c.FightC == nil {
|
||||
return nil, -1
|
||||
}
|
||||
@@ -113,7 +113,7 @@ func (h Controller) LoadPercent(data *fight.LoadPercentInboundInfo, c *player.Pl
|
||||
}
|
||||
|
||||
// UsePetItemInboundInfo 使用宠物道具
|
||||
func (h Controller) UsePetItemInboundInfo(data *fight.UsePetItemInboundInfo, c *player.Player) (result *info.UsePetIteminfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) UsePetItemInboundInfo(data *UsePetItemInboundInfo, c *player.Player) (result *info.UsePetIteminfo, err errorcode.ErrorCode) {
|
||||
if err := h.checkFightStatus(c); err != 0 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -128,7 +128,7 @@ func (h Controller) UsePetItemInboundInfo(data *fight.UsePetItemInboundInfo, c *
|
||||
}
|
||||
|
||||
// FightChat 战斗聊天
|
||||
func (h Controller) FightChat(data *fight.ChatInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
func (h Controller) FightChat(data *ChatInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
if err := h.checkFightStatus(c); err != 0 {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user