refactor: 重构 CurrentPet 为 CurPet
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-04-04 04:34:43 +08:00
committed by cnb
parent 6439995434
commit 9c6f3988de
395 changed files with 1424 additions and 1424 deletions

View File

@@ -18,7 +18,7 @@ import (
type Input struct {
CanChange uint32 //是否可以死亡切换CanChange
// CanAction bool //是否可以行动
CurrentPet []*info.BattlePetEntity //当前上场精灵
CurPet []*info.BattlePetEntity //当前上场精灵
AllPet []*info.BattlePetEntity
Player common.PlayerI
Opp *Input
@@ -53,7 +53,7 @@ type Input struct {
func NewInput(c common.FightI, p common.PlayerI) *Input {
ret := &Input{FightC: c, Player: p}
ret.Effects = make([]Effect, 0)
ret.CurrentPet = make([]*info.BattlePetEntity, 0)
ret.CurPet = make([]*info.BattlePetEntity, 0)
// t := Geteffect(EffectType.Damage, 0)
// t.Effect.SetArgs(ret)
@@ -64,25 +64,25 @@ func NewInput(c common.FightI, p common.PlayerI) *Input {
}
func (our *Input) CurrentPetAt(index int) *info.BattlePetEntity {
if our == nil || index < 0 || index >= len(our.CurrentPet) {
func (our *Input) CurPetAt(index int) *info.BattlePetEntity {
if our == nil || index < 0 || index >= len(our.CurPet) {
return nil
}
return our.CurrentPet[index]
return our.CurPet[index]
}
func (our *Input) PrimaryCurrentPet() *info.BattlePetEntity {
return our.CurrentPetAt(0)
func (our *Input) PrimaryCurPet() *info.BattlePetEntity {
return our.CurPetAt(0)
}
func (our *Input) SetCurrentPetAt(index int, pet *info.BattlePetEntity) {
func (our *Input) SetCurPetAt(index int, pet *info.BattlePetEntity) {
if our == nil || index < 0 {
return
}
for len(our.CurrentPet) <= index {
our.CurrentPet = append(our.CurrentPet, nil)
for len(our.CurPet) <= index {
our.CurPet = append(our.CurPet, nil)
}
our.CurrentPet[index] = pet
our.CurPet[index] = pet
}
// 非原地交换收集非0血量精灵 + 0血量精灵拼接后返回
@@ -124,7 +124,7 @@ func (our *Input) SortPet() {
func (our *Input) GetPetInfo() *info.BattlePetEntity {
return our.PrimaryCurrentPet()
return our.PrimaryCurPet()
}
func (our *Input) SetOPP(t *Input) {
@@ -186,7 +186,7 @@ func (our *Input) GenSataus() {
}
func (our *Input) GenInfo() {
currentPet := our.PrimaryCurrentPet()
currentPet := our.PrimaryCurPet()
if currentPet == nil {
return
}
@@ -194,8 +194,8 @@ func (our *Input) GenInfo() {
our.RemainHp = int32(currentPet.Info.Hp)
our.SkillList = currentPet.Info.SkillList
// f.Second.SkillList = f.Second.CurrentPet.Info.SkillList
// f.Second.RemainHp = int32(f.Second.CurrentPet.Info.Hp)
// f.Second.SkillList = f.Second.CurPet.Info.SkillList
// f.Second.RemainHp = int32(f.Second.CurPet.Info.Hp)
// ret.FAttack = *f.First.AttackValue
// ret.SAttack = *f.Second.AttackValue