event

package
v0.24.4-1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Actor = "actor"

name of the optional event target parameter

View Source
const Actors = "actors"

name of kind which incorporates the player

View Source
const CapturePattern = "capture"

predefined pattern for finding event targets

View Source
const Object = "event"

name of the event object variable the fields of the object are listed as Field constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field int

fields for the event object

const (
	// name of the action
	Name Field = iota // name

	// target of the event ( used to determine event flow )
	Target // target

	// the object currently handling the event
	CurrentTarget // current target

	// setting this stops the rest of the current flow ( ex. bubbling )
	// clearing this stops lets other handlers on this target finish first.
	Interupt // interrupt

	// setting this interrupts all further processing;
	// clearing this allows the currently flow to finish first.
	Cancel // cancel
	//
	NumFields = iota
)

func (Field) Affine

func (f Field) Affine() (ret affine.Affinity)

func (Field) Index

func (f Field) Index() int

func (Field) String

func (i Field) String() string

type Flow

type Flow int

behavior of a given event type

const (
	// a direct call to a pattern
	Targets Flow = iota
	// patterns are raised from root object of the scene down to the targeted object.
	Captures
	// patterns are raised from the targeted object up to the root of the scene.
	Bubbles
)

func (Flow) String

func (i Flow) String() string

type Phase

type Phase int

the individual events raised for an action they are represented collectively by a "pattern set" each pattern in the set corresponding to a phase using naming convention and pattern sub-types to identify which is which.

const (
	BeforePhase Phase = iota
	TargetPhase
	AfterPhase
	//
	NumPhases = iota
)

phases are listed in call order

func (Phase) Flow

func (p Phase) Flow() (ret Flow)

determines the order to visit objects for a particular phase.

func (Phase) PatternName

func (p Phase) PatternName(action string) string

event phases are represented by separate patterns following a certain naming convention; each phase has a unique prefix followed by the name of the action; return that full, unique name: ex. "begin traveling"

func (Phase) String

func (p Phase) String() (ret string)

friendly string for the phase

Jump to

Keyboard shortcuts

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