Compose phase-wide and Richese bid commitments
Verify and publish checkpoint container / container (push) Successful in 11m13s

This commit is contained in:
Quintine committed 2026-11-16 19:31:35 +11:00
1 parent 38f1684e03
commit 9e020ccd64
12 files changed
+664 -13

No files matched your search

+6 -1
View File
@@ -21,7 +21,12 @@ export function MixedRicheseBidPromises(props: { game: GameView; busy: boolean;
!guide || game.richeseBidPromiseGuide !== guide || !action || guide.action !== action ||
JSON.stringify(action) !== signature || action.type !== 'richeseBid' || action.event !== auction.event ||
typeof action.richeseBidPromiseId !== 'string') return false;
return own.some(promise => promise.id === action.richeseBidPromiseId && promise.turn === game.turn &&
if (action.phaseAnyBidPromiseEvent !== undefined &&
(typeof action.phaseAnyBidPromiseEvent !== 'string' || action.phaseAnyBidLotEvent !== auction.event ||
!game.phaseAnyBidPromises.some(promise => promise.event === action.phaseAnyBidPromiseEvent &&
promise.player === game.me && promise.turn === game.turn && !promise.fulfilled && !promise.released))) return false;
return game.mixedRicheseBidPromises.some(promise => promise.player === game.me &&
promise.id === action.richeseBidPromiseId && promise.turn === game.turn &&
promise.event === auction.event && !promise.fulfilled && !promise.released);
};
const canGuide = () => !props.busy && isCurrentGuide();
+6
View File
@@ -25,6 +25,12 @@ export function PhaseAnyBidGuideButton(props: Props) {
typeof action.phaseAnyBidPromiseEvent !== 'string' ||
!current.phaseAnyBidPromises.some(promise => promise.event === action.phaseAnyBidPromiseEvent &&
promise.player === actor && promise.turn === turn && !promise.fulfilled && !promise.released)) return false;
if (action.richeseBidPromiseId !== undefined) {
if (action.type !== 'richeseBid' || typeof action.richeseBidPromiseId !== 'string' || !special ||
![...current.richeseBidPromises, ...current.mixedRicheseBidPromises].some(promise =>
promise.id === action.richeseBidPromiseId && promise.player === actor && promise.turn === turn &&
promise.event === special.event && !promise.fulfilled && !promise.released)) return false;
}
if (action.type === 'bid' || action.type === 'passBid')
return !!ordinary && current.auction === ordinary && ordinary.active === actor &&
JSON.stringify([ordinary.bid, ordinary.bidder, ordinary.active, ordinary.remaining]) === ordinarySignature &&
+8 -1
View File
@@ -15,7 +15,9 @@ export type RicheseBidPromiseReceipt = {
export type RicheseBidPromisePanelProps = {
promises: RicheseBidPromiseReceipt[];
guide: { action: Action } | null;
game: { turn: number; richeseAuction: { event: string; method?: 'onceAround' | 'silent' | 'normal' } | null };
game: { turn: number; me?: string;
phaseAnyBidPromises?: {event: string; player: string; turn: number; fulfilled?: boolean; released?: boolean}[];
richeseAuction: { event: string; method?: 'onceAround' | 'silent' | 'normal' } | null };
act: (action: Action) => void;
busy: boolean;
};
@@ -32,6 +34,11 @@ export function RicheseBidPromiseGuide(props: RicheseBidPromisePanelProps) {
game.turn === turn && !!auction && game.richeseAuction === auction &&
typeof auctionEvent === 'string' && auction.event === auctionEvent &&
typeof id === 'string' && action.type === 'richeseBid' &&
(action.phaseAnyBidPromiseEvent === undefined ||
typeof action.phaseAnyBidPromiseEvent === 'string' && action.phaseAnyBidLotEvent === auctionEvent &&
typeof game.me === 'string' && !!game.phaseAnyBidPromises?.some(promise =>
promise.event === action.phaseAnyBidPromiseEvent && promise.player === game.me && promise.turn === turn &&
!promise.fulfilled && !promise.released)) &&
props.promises.some(promise => promise.id === id && promise.turn === turn &&
promise.event === auctionEvent && !promise.fulfilled && !promise.released);
const canAct = () => !props.busy && isCurrent();