event

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 0 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event int
const (
	OnAttackWillLand Event = iota //target, AttackEvent
	OnDamage                      //target, AttackEvent, amount, crit

	OnAuraDurabilityAdded    //target, ele, durability
	OnAuraDurabilityDepleted //target, ele
	// OnReaction               //target, AttackEvent, ReactionType
	ReactionEventStartDelim
	OnOverload       //target, AttackEvent
	OnSuperconduct   //target, AttackEvent
	OnMelt           //target, AttackEvent
	OnVaporize       //target, AttackEvent
	OnFrozen         //target, AttackEvent
	OnElectroCharged //target, AttackEvent
	OnSwirlHydro
	OnSwirlCryo
	OnSwirlElectro
	OnSwirlPyro
	OnCrystallizeHydro
	OnCrystallizeCryo
	OnCrystallizeElectro
	OnCrystallizePyro
	ReactionEventEndDelim
	//other stuff
	OnStamUse          //abil
	OnShielded         //shield
	OnCharacterSwap    //prev, next
	OnParticleReceived //particle
	OnEnergyChange     //character_received_index, pre_energy, energy_change, src (post-energy available in character_received)
	OnTargetDied       //target
	OnCharacterHit     //nil <- this is for when the character is going to get hit but might be shielded from dmg
	OnCharacterHurt    //amount
	OnHeal             //src char, target character, amount
	//ability use
	OnActionExec   //ActiveCharIndex, action.Action, param
	OnSkill        //nil
	OnBurst        //nil
	OnAttack       //nil
	OnChargeAttack //nil
	OnPlunge       //nil
	OnAimShoot     //nil
	OnDash
	//sim stuff
	OnInitialize  //nil
	OnStateChange //prev, next
	OnTargetAdded //t
	EndEventTypes //elim
)

type EventHook

type EventHook func(args ...interface{}) bool

type Eventter

type Eventter interface {
	Subscribe(e Event, f EventHook, key string)
	Unsubscribe(e Event, key string)
	Emit(e Event, args ...interface{})
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New() *Handler

func (*Handler) Emit

func (h *Handler) Emit(e Event, args ...interface{})

func (*Handler) Subscribe

func (h *Handler) Subscribe(e Event, f EventHook, key string)

func (*Handler) Unsubscribe

func (h *Handler) Unsubscribe(e Event, key string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL