earwax.event_matcher module¶
Provides the EventMatcher class.
-
class
earwax.event_matcher.EventMatcher(game: Game, name: str)¶ Bases:
objectMatches events for
Gameinstances.An object to call events on a
Gameinstance’slevelproperty.Used to prevent us writing loads of events out.
Variables: - game – The game this matcher is bound to.
- name – The name of the event this matcher uses.
-
dispatch(*args, **kwargs) → None¶ Dispatch this event.
Find the appropriate event on game.level, if game.level is not None.
If
self.game.leveldoesn’t have an event of the proper name, search instead onself.game.Parameters: - args – The positional arguments to pass to any event that is found.
- kwargs – The keyword arguments to pass to any event that is found.