GameEvent class abstract

Base class for all events dispatched through the EventBus.

Events are lightweight data objects that systems can fire and other systems can subscribe to, enabling decoupled communication.

class DamageEvent extends GameEvent {
  final Entity target;
  final double amount;
  DamageEvent(this.target, this.amount);
}

// Producer system:
world.events.fire(DamageEvent(entity, 25.0));

// Consumer system (in onAddedToWorld or initialize):
world.events.on<DamageEvent>((event) {
  // handle damage
});
Implementers

Constructors

GameEvent()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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