event

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event int
const (
	OnEnemyHit     Event = iota //target, AttackEvent
	OnPlayerHit                 //target, AttackEvent
	OnGadgetHit                 //target, AttackEvent
	OnEnemyDamage               //target, AttackEvent, amount, crit
	OnGadgetDamage              //target, AttackEvent

	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         //target, AttackEvent
	OnSwirlCryo          //target, AttackEvent
	OnSwirlElectro       //target, AttackEvent
	OnSwirlPyro          //target, AttackEvent
	OnCrystallizeHydro   //target, AttackEvent
	OnCrystallizeCryo    //target, AttackEvent
	OnCrystallizeElectro //target, AttackEvent
	OnCrystallizePyro    //target, AttackEvent
	OnAggravate          //target, AttackEvent
	OnSpread             //target, AttackEvent
	OnQuicken            //target, AttackEvent
	OnBloom              //target, AttackEvent
	OnHyperbloom         //target, AttackEvent
	OnBurgeon            //target, AttackEvent
	OnBurning            //target, AttackEvent
	OnShatter            //target, AttackEvent; at the end to simplify all reaction event subs since it's normally not considered as an elemental reaction
	ReactionEventEndDelim
	OnDendroCore //Gadget
	//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, AttackEvent
	OnHeal             //src char, target character, amount
	OnPlayerHPDrain    //DrainInfo
	//ability use
	OnActionFailed //ActiveCharIndex, action.Action, param, action.ActionFailure
	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
	OnEnemyAdded  //t
	OnTick
	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