diff --git a/pysollib/games/spider.py b/pysollib/games/spider.py index ccbbc419..eefdd504 100644 --- a/pysollib/games/spider.py +++ b/pysollib/games/spider.py @@ -329,7 +329,7 @@ class Rachel(pysollib.game.StartDealRowAndCards, RelaxedSpider): # * Scorpion Tail - building down by alternate color # ************************************************************************ -class Scorpion_RowStack(Spider_RowStack, Yukon_SS_RowStack): +class Scorpion_RowStack(Yukon_SS_RowStack, Spider_RowStack): canDropCards = Spider_RowStack.canDropCards diff --git a/pysollib/stack.py b/pysollib/stack.py index ad029fdd..f972991d 100644 --- a/pysollib/stack.py +++ b/pysollib/stack.py @@ -2474,6 +2474,8 @@ class BasicRowStack(OpenStack): # Abstract class. class SequenceRowStack(SequenceStack_StackMethods, BasicRowStack): + canMoveCards = OpenStack.canMoveCards + def __init__(self, x, y, game, **cap): kwdefault(cap, max_move=999999, max_accept=999999) BasicRowStack.__init__(self, x, y, game, **cap) diff --git a/tests/lib/pysol_tests/scorpion_canMove.py b/tests/lib/pysol_tests/scorpion_canMove.py index 650fb986..aab00015 100644 --- a/tests/lib/pysol_tests/scorpion_canMove.py +++ b/tests/lib/pysol_tests/scorpion_canMove.py @@ -39,7 +39,7 @@ class Mock_S_Game: class MyTests(unittest.TestCase): - def test_import(self): + def test_canMoveCards(self): g = MockGame() stack = Scorpion_RowStack(0, 0, g) cards = [ @@ -53,3 +53,18 @@ class MyTests(unittest.TestCase): stack.addCard(c) stack.canMoveCards(stack.cards[6:]) self.assertTrue(stack) + + def test_canMoveCards_non_top(self): + g = MockGame() + stack = Scorpion_RowStack(0, 0, g) + cards = [ + AbstractCard(1000+r*100+s*10, 0, s, r, g) + for s, r in [(2, 5), (3, 7), (2, 7), (2, 0), + (2, 3), (2, 4), (1, 4)] + ] + for c in cards: + c.face_up = True + c.item = MockItem() + stack.addCard(c) + self.assertTrue(stack.canMoveCards(stack.cards[4:])) + self.assertTrue(stack)