package DX::ResolutionSpace;
+use DX::Utils qw(step);
use DX::Class;
+has proposition => (is => 'ro');
+
has geometry_depends_on => (is => 'ro', required => 1);
has members => (is => 'ro', required => 1);
return $self->but(members => [ $first->remainder, @rest ]);
}
+sub next_step {
+ my ($self) = @_;
+ return undef unless @{$self->members};
+ return step(
+ resolves => $self->proposition,
+ resolution_space => $self,
+ );
+}
+
1;
sub resolution_step_for {
my ($self, $prop, @args) = @_;
- my $rspace = $self->_resolution_space_for(@args);
- return undef unless @{$rspace->members};
- return step(
- resolves => $prop,
- resolution_space => $rspace
- );
+ $self->_resolution_space_for(@args)
+ ->but(proposition => $prop)
+ ->next_step;
}
1;