event

package
v0.24.8 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 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 CancellationStatus

type CancellationStatus int

traits controlling event processing higher numbers indicate a higher severity.

const (
	// keep processing other handlers and other flows.
	ContinueNormally CancellationStatus = iota // continue normally

	// stops the current flow after other handlers finish.
	InterruptLater // interrupt later

	// stops the current flow without letting other handlers run.
	InterruptNow // interrupt now

	// stops all flows after the current flow.
	CancelLater // cancel later

	// stops all further processing.
	CancelNow // cancel now

	//
	NumStatus = iota
)

func (CancellationStatus) String

func (i CancellationStatus) String() string

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

	// a string containing the current cancellation status
	Status // status

	//
	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

func (Field) Type

func (f Field) Type() (ret 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