Honor Caladan auction knowledge in Truthtrance
Verify and publish checkpoint container / container (push) Canceled after 0s
Verify and publish checkpoint container / container (push) Canceled after 0s
This commit is contained in:
1 parent
34f533ae8d
commit
4ec4f843a7
13 files changed
+241
-25
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import type { Game } from './engine';
|
||||
|
||||
/** Physical card identity is not a lot identity: the same card can later
|
||||
* re-enter an ordinary auction. Return null when no current lot exists. */
|
||||
export function originalAuctionInspectionLot(
|
||||
game: Pick<Game, 'richeseAuction' | 'auction' | 'turn'>,
|
||||
): string | null {
|
||||
if (game.richeseAuction) return typeof game.richeseAuction.event === 'string'
|
||||
? game.richeseAuction.event : null;
|
||||
const auction = game.auction;
|
||||
if (!auction || !Number.isSafeInteger(auction.index) || auction.index < 0 ||
|
||||
!Array.isArray(auction.cards) || !auction.cards[auction.index] ||
|
||||
typeof auction.cards[auction.index].id !== 'string') return null;
|
||||
return JSON.stringify([auction.occupiedEvent ?? game.turn, auction.index, auction.cards[auction.index].id]);
|
||||
}
|
||||
Reference in new issue
Block a user