endplay.types.contract
Classes:
|
Class representing a specific contract |
- class endplay.types.contract.Contract(data: Optional[Union[contractType, str]] = None, *, level: Optional[int] = None, denom: Optional[Denom] = None, declarer: Optional[Player] = None, penalty: Optional[Penalty] = None, result: Optional[int] = None)
Bases:
object
Class representing a specific contract
Attributes:
The declarer of the contract
The denomination of the contract
The level of the contract
The number of tricks over or under the contract made
Methods:
copy
()Return a copy of this contract object
from_auction
(dealer, auction)Construct a contract from a bidding sequence
Returns true if the contract represents a passout
score
(vul)The number of points the contract would score for the declarer
- _pat = re.compile('^([1-7])((?:NT?)|S|H|D|C)([NSEW]?)((?:XX|X|D|R)?)((?:=|(?:[+-]\\d+))?)$')
- static from_auction(dealer: Player, auction: Sequence[Bid])
Construct a contract from a bidding sequence
- is_passout() bool
Returns true if the contract represents a passout
- property level: int
The level of the contract
- property result: int
The number of tricks over or under the contract made