v0.3.1 — multiplayer groundwork: 13 engine tests covering 2-4 player games, a seat parameter on snapshot and actionMenu so a player sees their own railroad rather than seat 0's, and the 22 opponent-directed cards held out of every deck until they are built

This commit is contained in:
Jesse
2026-08-12 22:37:10 -04:00
parent 1bf1e95058
commit 216006b091
11 changed files with 460 additions and 44 deletions
+14 -8
View File
@@ -62,8 +62,10 @@ describe('card catalogue (component 1)', () => {
// Two entries are dealt ZERO copies and kept in the catalogue so the design stays visible:
// Poling, whose effect is "TBD in the source", and the sharp curves, whose only difference from
// an ordinary curve was a Move cost nothing ever charged.
// DECK_SIZE is the CATALOGUE, 235. The deck actually dealt is smaller: the 22 opponent-directed
// cards are held back in every mode until they are implemented, so `buildDeck` returns 213.
assert.equal(DECK_SIZE, 235);
assert.equal(buildDeck().length, DECK_SIZE);
assert.equal(buildDeck().length, SOLITAIRE_DECK_SIZE);
});
it('matches the design deck composition exactly', () => {
@@ -89,14 +91,18 @@ describe('card catalogue (component 1)', () => {
});
it('removes opponent-directed cards from a solitaire deck', () => {
// Q6 — Space-use and Action cards can only be played AT another player, so in a one-player
// game they would be 22 of 235 draws (9%) that do nothing.
// Q6 took Space-use and Action cards out of solitaire, where they have no legal target. They are
// now out of the COMPETITIVE deck too, until they are implemented: `checkPlay` answers both
// categories NOT_IMPLEMENTED, so dealing them would make 22 of 235 draws (9%) reject outright.
assert.equal(SOLITAIRE_DECK_SIZE, 213);
const solo = buildDeck('solitaire');
assert.equal(solo.length, SOLITAIRE_DECK_SIZE);
assert.ok(!solo.some((c) => c.kind.kind === 'spaceUse' || c.kind.kind === 'action'));
// A competitive deck keeps them. Poling and the sharp curves are dealt none.
assert.equal(buildDeck('competitive').length, 235);
for (const mode of ['solitaire', 'competitive'] as const) {
const deck = buildDeck(mode);
assert.equal(deck.length, SOLITAIRE_DECK_SIZE, `${mode} deck size`);
assert.ok(
!deck.some((c) => c.kind.kind === 'spaceUse' || c.kind.kind === 'action'),
`${mode} deck still holds opponent-directed cards`,
);
}
});
it('deals track FROM the deck, at the sheet\'s counts', () => {