endplay.types.suitholding
Classes:
|
- class endplay.types.suitholding.SuitHolding(data: Array | str = '', idx: int | None = None)
Bases:
objectMethods:
add(rank)Add a rank to the suit holding
clear()Removes all cards from the holding
copy()extend(ranks)Add multiple ranks to the suit holding
from_pbn(pbn)Construct a SuitHolding object from a PBN string
remove(rank)Remove a rank from the suit holding
to_pbn()Create a PBN representation of the suit holding
- add(rank: Rank | AlternateRank | str) bool
Add a rank to the suit holding
- Parameters:
rank – The rank to add
- Returns:
False if the rank was already in the holding, True otherwise
- clear() None
Removes all cards from the holding
- copy() SuitHolding
- extend(ranks: Iterable[Rank | AlternateRank | str]) int
Add multiple ranks to the suit holding
- Parm ranks:
An iterable of the ranks to add
- Returns:
The number of ranks successfully added
- static from_pbn(pbn: str) SuitHolding
Construct a SuitHolding object from a PBN string
- remove(rank: Rank | AlternateRank | str) bool
Remove a rank from the suit holding
- Parameters:
rank – The rank to remove
- Returns:
False if the rank wasn’t in the holding, True otherwise
- to_pbn() str
Create a PBN representation of the suit holding