endplay.types.contract
Classes:
|
Class representing a specific contract |
- class endplay.types.contract.Contract(data: contractType | str | None = None, *, level: int | None = None, denom: Denom | None = None, declarer: Player | None = None, penalty: Penalty | None = None, result: int | None = None)
Bases:
objectClass 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