sub with_actions {
my ($self, @actions) = @_;
my $hyp = $self;
+ my @events;
foreach my $act (@actions) {
return undef unless $self->action_policy->allows($act);
- ($hyp, my @events) = $act->dry_run($hyp);
- return undef unless $hyp;
- $hyp = $hyp->but_recheck_for(@events);
+ ($hyp, my @these_events) = $act->dry_run($hyp);
return undef unless $hyp;
+ push @events, @these_events;
}
+ $hyp = $hyp->but_recheck_for(@events);
return $hyp;
}