Skip to content

Commit

Permalink
[states.base] Add contains for states
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometheus3375 committed Jul 20, 2024
1 parent b636ce4 commit d448b3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions solve/states/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def shapes_available(self, /) -> Multiset[Shape2D]:
"""
raise NotImplementedError

def __contains__(self, item: Shape2D, /) -> bool:
return item in self.shapes_available

def is_shape_required(self, shape: Shape2D, /) -> bool:
"""
Return ``True`` if the given shape is required for this state to be done.
Expand Down

0 comments on commit d448b3c

Please sign in to comment.