Closed skaldarnar closed 3 years ago
Could we add a component filter to DummySystem's @ReceiveEvent
instead? Would that be better?
Could we add a component filter to DummySystem's
@ReceiveEvent
instead? Would that be better?
Done in 9e07194
I think we need both, at least I hope that the goal of sending this event is that the system reacts to it... :eyes:
oh, I was thinking more like
@ReceiveEvent(components=DummyComponent.class)
public void onDummyEvent(DummyEvent event, EntityRef entity /*, DummyComponent component */)
but if we can put the component in the signature to skip the entity.getComponent
call, that's handy too.
Does it do the same thing as naming the component in the annotation, or is that component argument nullable?
either way, I'm not too fussed about it, feel free to merge 👍
I think last time I looked at this I got really distracted by the question of what was registering that system and if there were any way to selectively avoid it.
Does it do the same thing as naming the component in the annotation, or is that component argument nullable?
@keturn afaik these arguments are not nullable and serve the same purpose as listing them in the annotation, except that you can take a shortcut for giving them a name and retrieving them from the entity.
I couldn't find any good/clear documentation on this, though (for the annotation it is described in the Javadoc). There's some information in the Entity System Tutorial as well as in the Event Interaction Tutorial.
The engine wiki has some info on Events in Detail which is not nearly as detailed as it should be :see_no_evil: ... but another page on Processing Events has more info on it :upside_down_face:
By working on #55 we discovered that some of the tests are broken independent of any gestalt and module management issues.
This PR fixes those tests (at least locally) by giving the target entity a
DummyComponent
, as is expected byDummySystem
.