refactor: 重构效果系统中的上下文引用
This commit is contained in:
@@ -74,6 +74,15 @@ func (e *EffectNode) TargetInput() *input.Input {
|
||||
func (e *EffectNode) OpponentInput() *input.Input {
|
||||
return e.Ctx().Opp
|
||||
}
|
||||
|
||||
// IsOwner reports whether the current phase's Our side owns this effect.
|
||||
func (e *EffectNode) IsOwner() bool {
|
||||
if e.Ctx().Our == nil || len(e.Ctx().Our.CurPet) == 0 || e.Ctx().Our.CurPet[0] == nil {
|
||||
return false
|
||||
}
|
||||
return e.ID().GetCatchTime() == e.Ctx().Our.CurPet[0].Info.CatchTime
|
||||
}
|
||||
|
||||
func (e *EffectNode) Ctx() *input.Ctx {
|
||||
|
||||
return &e.EffectContextHolder.Ctx
|
||||
|
||||
Reference in New Issue
Block a user