EventCollision<T extends App<T>> class

Inheritance
Mixed-in types

Constructors

EventCollision(T app, Entity<T> a, Entity<T> b, Vector2D normal, double penetration)

Properties

a Entity<T>
The first participant in the collision.
final
app → T
finalinherited
b Entity<T>
The second participant in the collision.
final
backend UnhingedBackend
Shorthand for App.backend.
no setterinherited
draw Drawers<T>
Shorthand for App.draw.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id int
Per-type unique identifier, auto-assigned in the constructor.
no setterinherited
input InputSystem<T>
Shorthand for App.input.
no setterinherited
isStopped bool
Whether propagation has been halted via stopPropagation.
no setterinherited
name String
Human-readable name, defaults to <runtimeType>_<id>.
getter/setter pairinherited
namedId String
Per-type unique String identifier, auto-assigned in the constructor. Defaults to <runtimeType>_<id>.
no setterinherited
normal Vector2D
final
origin ECSBase<T>?
The node that originally emitted this event.
getter/setter pairinherited
parent ECSBase<T>?
The parent object in the ECS tree, if any.
getter/setter pairinherited
penetration double
final
priority int
Relative ordering priority used when processing queued events. Events with lower priority values are processed first.
getter/setter pairinherited
renderer Renderer<T>
Shorthand for App.renderer.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scene Scene<T>
Shorthand for App.currentScene.
no setterinherited
sceneBounds Bounds
no setterinherited
sceneHeight double
no setterinherited
sceneSize Vector2D
no setterinherited
sceneWidth double
no setterinherited
scope EventScope?
How far this event should propagate.
getter/setter pairinherited
screenHeight double
Shorthand for App's height.
no setterinherited
screenSize Vector2D
Shorthand for App.screenSize.
no setterinherited
screenWidth double
Shorthand for App's width.
no setterinherited
self Event<T>
This object cast to T.
no setterinherited
simTime double
getter/setter pairinherited
time AppTime<T>
Shorthand for App.time.
no setterinherited

Methods

as<A extends E, B extends E>() → (A, B)?
Returns the pair typed as (A, B) if the collision is between an A and a B (in either order), or null if neither ordering matches.
inherited
asHas<A extends E, B extends Comp<T>, C extends E, D extends Comp<T>>() → (A, C)?
Returns the pair typed as (A, C) only if the types match (A/C) and the corresponding components are present (B on the first, D on the second).
inherited
callback(void callback()) → void
inherited
getAncestors() Iterable<ECSBase<T>>
Returns every ancestor of this component, from immediate parent up to the root.
inherited
getDepth() int
Returns the depth/level in the hierarchy.
inherited
getParentAs<P extends ECSBase<T>>() → P?
Returns parent cast to P, or null if the cast would fail.
inherited
getPath() List<ECSBase<T>>
Returns the path from the root down to this one, inclusive.
inherited
has<A extends Comp<T>, B extends Comp<T>>() → (Entity<T>, Entity<T>)?
Returns the pair ordered so that the first element carries component A and the second carries component B, or null if the collision doesn't involve both component types.
inherited
hasParentOf<P extends ECSBase<T>>() bool
Whether parent is of type P.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onSelf(void fn(Event<T> self)) Event<T>
Calls fn with self and returns self, for fluent chaining.
inherited
run(Task<T> task) → void
inherited
Links this event to link so that stopping propagation on one (via stopPropagation) also stops the other.
inherited
stopPropagation() → void
Halts further propagation of this event (and any event linked via setLink). Already-visited nodes are unaffected; only handlers further down the propagation chain are skipped.
inherited
task(Task<T> task) → void
inherited
toString() String
A string representation of this object.
inherited
uniqKey(String key) String
Returns a key namespaced to this object's namedId.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited