Files
bl/logic/service/fight/input/ctx.go
2026-04-04 06:11:01 +08:00

51 lines
826 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package input
import "blazing/logic/service/fight/info"
type LegacySides struct {
Our *Input // 兼容旧 effect当前执行侧
Opp *Input // 兼容旧 effect当前执行侧的对位
}
type EffectBinding struct {
Source *Input // effect 绑定的输入源,等价于 e.GetInput()
Carrier *Input // 当前持有该 effect 的输入源
Target *Input // 当前 effect 实际作用/挂载的输入源
}
type Ctx struct {
LegacySides
EffectBinding
*info.SkillEntity //action本身
// *info.DamageZone //伤害
}
func (c *Ctx) Self() *Input {
if c == nil {
return nil
}
if c.Source != nil {
return c.Source
}
return c.Our
}
func (c *Ctx) Receiver() *Input {
if c == nil {
return nil
}
if c.Target != nil {
return c.Target
}
if c.Carrier != nil {
return c.Carrier
}
return c.Our
}