Skip to content

Commit

Permalink
Add typeless has to thing variable builder (#196)
Browse files Browse the repository at this point in the history
## What is the goal of this PR?

As deleting a roleplayer now requires typeless has (to avoid a derived isa being present), we added a has overload to ThingVariableBuilder in order to construct a typeless has.

## What are the changes implemented in this PR?

Adds has with signature of `T has(UnboundVariable variable)` to ThingVariableBuilder
  • Loading branch information
Alistair Crook authored Jan 27, 2021
1 parent 034dfb3 commit 7393534
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions java/pattern/variable/builder/ThingVariableBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ default T has(String type, UnboundVariable variable) {
return constrain(new ThingConstraint.Has(type, variable));
}

default T has(UnboundVariable variable) {
return constrain(new ThingConstraint.Has(variable));
}

T constrain(ThingConstraint.Isa constraint);

T constrain(ThingConstraint.Has constraint);
Expand Down

0 comments on commit 7393534

Please sign in to comment.