def moveMove(self, ncards, to_stack, frames=-1, shadow=-1): game, r = self.game, self.game.s.reserves[0] if to_stack is not r: SS_RowStack.moveMove(self, ncards, to_stack, frames=frames, shadow=shadow) return f = self._canDrawCard() assert f and game.draw_done == 0 and ncards == 1 # 1) top card from self to reserve game.updateStackMove(r, 2 | 16) # update view for undo game.moveMove(1, self, r, frames=frames, shadow=shadow) game.updateStackMove(r, 3 | 64) # update model game.updateStackMove(r, 1 | 16) # update view for redo # 2) second card from self to foundation/row if 1 or not game.demo: game.playSample("drop", priority=200) if frames == 0: frames = -1 game.moveMove(1, self, f, frames=frames, shadow=shadow) # 3) from reserve back to self # (need S_FILL because the move is normally not valid) old_state = game.enterState(game.S_FILL) game.moveMove(1, r, self, frames=frames, shadow=shadow) game.leaveState(old_state)
def moveMove(self, ncards, to_stack, frames=-1, shadow=-1): SS_RowStack.moveMove(self, ncards, to_stack, frames, shadow) if self.game.base_rank is None and to_stack in self.game.s.foundations: old_state = self.game.enterState(self.game.S_FILL) self.game.saveStateMove(2 | 16) # for undo self.game.base_rank = to_stack.cards[-1].rank self.game.saveStateMove(1 | 16) # for redo self.game.leaveState(old_state)
def moveMove(self, ncards, to_stack, frames=-1, shadow=-1): SS_RowStack.moveMove(self, ncards, to_stack, frames, shadow) if self.game.base_rank is None and to_stack in self.game.s.foundations: old_state = self.game.enterState(self.game.S_FILL) self.game.saveStateMove(2 | 16) # for undo self.game.base_rank = to_stack.cards[-1].rank self.game.saveStateMove(1 | 16) # for redo self.game.leaveState(old_state)
def moveMove(self, ncards, to_stack, frames=-1, shadow=-1): game, r = self.game, self.game.s.reserves[0] if to_stack is not r: SS_RowStack.moveMove( self, ncards, to_stack, frames=frames, shadow=shadow) return f = self._canDrawCard() assert f and game.draw_done == 0 and ncards == 1 # 1) top card from self to reserve game.updateStackMove(r, 2 | 16) # update view for undo game.moveMove(1, self, r, frames=frames, shadow=shadow) game.updateStackMove(r, 3 | 64) # update model game.updateStackMove(r, 1 | 16) # update view for redo # 2) second card from self to foundation/row if 1 or not game.demo: game.playSample("drop", priority=200) if frames == 0: frames = -1 game.moveMove(1, self, f, frames=frames, shadow=shadow) # 3) from reserve back to self # (need S_FILL because the move is normally not valid) old_state = game.enterState(game.S_FILL) game.moveMove(1, r, self, frames=frames, shadow=shadow) game.leaveState(old_state)