def _check_and_trigger_events(self):
            """
            This should usually be called in before_step()
            """
            for event in events.items():
                if event.should_be_triggered():
                    event.trigger()

            This should usually be called in before_step()
            
metadrive/manager/event_manager.py