refactor: 重、、、、
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user