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:
@@ -123,8 +123,6 @@ func (f *FightC) LoadPercent(c common.PlayerI, percent int32) {
|
||||
|
||||
}
|
||||
|
||||
var meetpet = make(map[int]model.PetInfo)
|
||||
|
||||
func (f *FightC) initplayer(c common.PlayerI, b []model.PetInfo) (*input.Input, errorcode.ErrorCode) {
|
||||
r := c.CanFight()
|
||||
if c.CanFight() != 0 {
|
||||
@@ -146,6 +144,12 @@ func (f *FightC) initplayer(c common.PlayerI, b []model.PetInfo) (*input.Input,
|
||||
if len(in.AllPet) == 0 {
|
||||
return nil, errorcode.ErrorCodes.ErrNoEligiblePokemon
|
||||
}
|
||||
switch f.Info.Mode {
|
||||
case info.BattleMode.SINGLE_MODE:
|
||||
in.AllPet = in.AllPet[:1]
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
in.CurrentPet = in.AllPet[0]
|
||||
return in, 0
|
||||
|
||||
Reference in New Issue
Block a user