refactor: 重、、、、

This commit is contained in:
xinian
2026-04-04 06:11:01 +08:00
committed by cnb
parent 28d92c1e18
commit 3a9932e307
18 changed files with 665 additions and 680 deletions

View File

@@ -135,6 +135,33 @@ func (f *FightC) isOurPlayerID(userID uint32) bool {
return userID == f.ownerID
}
func (f *FightC) bindInputFightContext(inputs []*input.Input) {
for _, fighter := range inputs {
if fighter == nil {
continue
}
fighter.FightC = f
if fighter.Player != nil {
fighter.Player.SetFightC(f)
}
}
}
func (f *FightC) linkOppInputs() {
for actorIndex, fighter := range f.Our {
if fighter == nil {
continue
}
fighter.SetOPP(f.selectInput(f.Opp, actorIndex))
}
for actorIndex, fighter := range f.Opp {
if fighter == nil {
continue
}
fighter.SetOPP(f.selectInput(f.Our, actorIndex))
}
}
func (f *FightC) getSideInputs(userID uint32, isOpposite bool) []*input.Input {
isOur := f.isOurPlayerID(userID)
if isOpposite {