diff --git a/solve/states/base.py b/solve/states/base.py index 8a66cda..559c59d 100644 --- a/solve/states/base.py +++ b/solve/states/base.py @@ -61,7 +61,7 @@ def is_done(self, /) -> bool: """ Whether this state is done. """ - raise NotImplementedError + return len(self.shapes_to_give) == 0 and len(self.shapes_to_receive) == 0 @property def shapes_available(self, /) -> Multiset[Shape2D]: diff --git a/solve/states/rooms.py b/solve/states/rooms.py index 343a5cd..69a7a44 100644 --- a/solve/states/rooms.py +++ b/solve/states/rooms.py @@ -41,17 +41,17 @@ def __init__( shapes_to_receive=shapes_to_receive, ) - @property - def is_done(self, /) -> bool: - """ - Whether this room contains exactly 2 different opposite shapes - and none of dropping shapes must be given. - """ - return ( - not self.shapes_to_give - and len(drops := set(self.dropping_shapes)) == 2 - and drops == shape2opposite[self.own_shape] - ) + # @property + # def is_done(self, /) -> bool: + # """ + # Whether this room contains exactly 2 different opposite shapes + # and none of dropping shapes must be given. + # """ + # return ( + # not self.shapes_to_give + # and len(drops := set(self.dropping_shapes)) == 2 + # and drops == shape2opposite[self.own_shape] + # ) def pass_shape(self, shape: Shape2D, other: Self, /) -> [Self, Self]: """ diff --git a/solve/states/statues.py b/solve/states/statues.py index 15caad3..27af3ae 100644 --- a/solve/states/statues.py +++ b/solve/states/statues.py @@ -42,10 +42,10 @@ def __init__( shapes_to_receive=shapes_to_receive, ) - @property - def is_done(self, /) -> bool: - t1, t2 = shape2opposite[self.own_shape] - return self.shape_held == t1 + t2 + # @property + # def is_done(self, /) -> bool: + # t1, t2 = shape2opposite[self.own_shape] + # return self.shape_held == t1 + t2 def dissect(self, shape1: Shape2D, other: Self, shape2: Shape2D, /) -> [Self, Self]: """