Skip to content

Moves

patiencepilot.moves

Structured move and move-result types.

TableauToTableau dataclass

Move one or more visible cards between tableau columns.

Source code in src/patiencepilot/moves.py
12
13
14
15
16
17
18
@dataclass(frozen=True, slots=True)
class TableauToTableau:
    """Move one or more visible cards between tableau columns."""

    source: int
    destination: int
    count: int = 1

TableauToFoundation dataclass

Move the top visible card from a tableau column to its foundation.

Source code in src/patiencepilot/moves.py
21
22
23
24
25
@dataclass(frozen=True, slots=True)
class TableauToFoundation:
    """Move the top visible card from a tableau column to its foundation."""

    source: int

WasteToTableau dataclass

Move the top waste card to a tableau column.

Source code in src/patiencepilot/moves.py
28
29
30
31
32
@dataclass(frozen=True, slots=True)
class WasteToTableau:
    """Move the top waste card to a tableau column."""

    destination: int

WasteToFoundation dataclass

Move the top waste card to its foundation.

Source code in src/patiencepilot/moves.py
35
36
37
@dataclass(frozen=True, slots=True)
class WasteToFoundation:
    """Move the top waste card to its foundation."""

DrawFromStock dataclass

Draw one or more cards from stock to waste.

Source code in src/patiencepilot/moves.py
40
41
42
@dataclass(frozen=True, slots=True)
class DrawFromStock:
    """Draw one or more cards from stock to waste."""

RecycleWaste dataclass

Recycle the waste pile into stock when the rules allow it.

Source code in src/patiencepilot/moves.py
45
46
47
@dataclass(frozen=True, slots=True)
class RecycleWaste:
    """Recycle the waste pile into stock when the rules allow it."""

MovedCards dataclass

Effect describing cards moved between locations.

Source code in src/patiencepilot/moves.py
55
56
57
58
59
60
61
@dataclass(frozen=True, slots=True)
class MovedCards:
    """Effect describing cards moved between locations."""

    cards: tuple[Card, ...]
    source: str
    destination: str

RevealedTableauCard dataclass

Effect describing a tableau card automatically revealed by the engine.

Source code in src/patiencepilot/moves.py
64
65
66
67
68
69
@dataclass(frozen=True, slots=True)
class RevealedTableauCard:
    """Effect describing a tableau card automatically revealed by the engine."""

    column: int
    card: Card

DrewStockCards dataclass

Effect describing cards drawn from stock to waste.

Source code in src/patiencepilot/moves.py
72
73
74
75
76
@dataclass(frozen=True, slots=True)
class DrewStockCards:
    """Effect describing cards drawn from stock to waste."""

    cards: tuple[Card, ...]

RecycledWaste dataclass

Effect describing waste cards recycled into stock.

Source code in src/patiencepilot/moves.py
79
80
81
82
83
@dataclass(frozen=True, slots=True)
class RecycledWaste:
    """Effect describing waste cards recycled into stock."""

    count: int

MoveResult dataclass

The result of applying a legal move.

Source code in src/patiencepilot/moves.py
89
90
91
92
93
94
95
@dataclass(frozen=True, slots=True)
class MoveResult:
    """The result of applying a legal move."""

    move: Move
    state: GameState
    effects: tuple[MoveEffect, ...] = ()