endplay.interact
- endplay.interact.frontends
- endplay.interact.frontends.cmd
CmdFrontend
CmdFrontend.cmdloop()
CmdFrontend.do_analyse()
CmdFrontend.do_board()
CmdFrontend.do_checkpoint()
CmdFrontend.do_ddtable()
CmdFrontend.do_display()
CmdFrontend.do_exit()
CmdFrontend.do_first()
CmdFrontend.do_hcp()
CmdFrontend.do_history()
CmdFrontend.do_par()
CmdFrontend.do_pbn()
CmdFrontend.do_play()
CmdFrontend.do_redeal()
CmdFrontend.do_reset()
CmdFrontend.do_set()
CmdFrontend.do_shuffle()
CmdFrontend.do_solve()
CmdFrontend.do_trump()
CmdFrontend.do_undo()
CmdFrontend.emptyline()
CmdFrontend.interact()
CmdFrontend.onecmd()
CmdFrontend.postcmd()
- endplay.interact.frontends.curses
- endplay.interact.frontends.tk
- endplay.interact.frontends.cmd
- endplay.interact.__main__
- endplay.interact.interactivedeal
InteractiveDeal
InteractiveDeal._undo_first()
InteractiveDeal._undo_play()
InteractiveDeal._undo_set()
InteractiveDeal._undo_trump()
InteractiveDeal._undo_unplay()
InteractiveDeal.checkpoint()
InteractiveDeal.first
InteractiveDeal.play()
InteractiveDeal.reset()
InteractiveDeal.trump
InteractiveDeal.undo()
InteractiveDeal.unplay()
Provides the InteractiveDeal class which keeps an undo stack whenever its state is modified, making it easier to interact with the deal.
Classes:
|
A Deal which keeps track of changes made to it allowing actions to be undone. |
- class endplay.interact.InteractiveDeal(pbn: Optional[str] = None, first: Player = Player.north, trump: Denom = Denom.nt)
Bases:
Deal
A Deal which keeps track of changes made to it allowing actions to be undone. This is the basis of the various frontends to the interact package.
Methods:
_undo_first
(player)_undo_play
(arg)_undo_set
(player, pbn)_undo_trump
(denom)_undo_unplay
(player, card, toHand)Clear undo history so that reset will bring the deal back to this state
play
(card[, fromHand])Play a card to the current trick.
reset
()Undo all actions in the undo history
undo
()Undo the previous action, if it changed the current deal
unplay
([toHand])Unplay the last card played to the current trick.
Attributes:
The player to lead the first card to the current trick
The trump suit the deal is being played in
- _undo_first(player)
- _undo_play(arg)
- _undo_set(player, pbn)
- _undo_trump(denom)
- _undo_unplay(player, card, toHand)
- checkpoint()
Clear undo history so that reset will bring the deal back to this state
- play(card, fromHand: bool = True) None
Play a card to the current trick. If the played card completes the trick then the entire trick is cleared and first is set to the played who won the trick using trump as the trumps suit
- Parameters:
card – The cad to be played
fromHand – If true then the card will be removed from the hand of the player who is to play to the trick next and throw a RuntimeError if they do not hold this card.
- reset()
Undo all actions in the undo history
- undo()
Undo the previous action, if it changed the current deal