EventWriter<T extends EcsEvent> class
Writer interface for sending events to a channel.
Provides ergonomic methods for sending events with optional success confirmation.
Example:
final writer = context.events.writer<DamageEvent>();
// Send with confirmation
if (writer.trySend(DamageEvent(entity: target, amount: 10))) {
print('Damage event sent');
}
// Send without confirmation (fire-and-forget)
writer.send(DamageEvent(entity: target, amount: 5));
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
-
send(
T event) → void - Send an event (fire-and-forget).
-
sendBatch(
List< T> events) → int - Send multiple events in batch.
-
sendIf(
T event, {required bool condition}) → void - Send an event only if the condition is true.
-
toString(
) → String -
A string representation of this object.
inherited
-
trySend(
T event) → bool - Send an event, returning true if successful.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited