Replies: 2 comments 2 replies
-
You might be interested in #21408 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Did you see the API added in #21284 at the last minute? This feels like it's very close to what you're asking for, but perhaps I'm missing something? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The Awesome
I've come round to the
EntityEvent
api in most parts ofbeet
, thanks @Diddykonga i think you're right its best not to think of theEvent
type literally as a 'payload', reflecting on the lovely flat nature of html events helped with this as well.My pattern for non-default types is getting
new
to return aFnOnce
.The Tricky
There are some cases that
EntityEvent
just wasn't able to fit, for example the behavior treeOutcome
type is beautifully simple and my attempts to shoehorn it in resulted in an obscure mess for triggers, consumers and cases where the event needs to be stored for later triggering (target not yet known).I tried a generic
EntityEvent
container with anOutcome
payload but that results in a mismatch between the trigger and consumer type, so instead ive implemented the discussedEntityTargetTrigger
pattern.I'm a big fan of the
Trigger
api its super powerful, the challenge is that entity-specific usage requires extension methods for commands, world and anywhereEntityEvent
is being handled which feels like going against the grain of the intended api.Maybe too early to say at this point but the implementation got me wondering if this kind of custom entity-specific event could be more officially supported, ie
commands.observe
andcommands.trigger
could accept a more generalIntoEntityTargetEvent<M>
or something.Beta Was this translation helpful? Give feedback.
All reactions