Initial commit
This commit is contained in:
commit
8c709fb52f
771 files changed
+222983
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import type { Game } from '../game/engine';
|
||||
import type { Card } from '../game/cards';
|
||||
|
||||
/** Stage a selected hand in legacy component fixtures. Relocate the selected
|
||||
* physical IDs from prior deck/hand/discard custody instead of duplicating them.
|
||||
* This is scenario setup, not an engine action or a full-game initializer. */
|
||||
export function placeFixtureHand(g: Game, index: number, cards: Card[]) {
|
||||
const ids = new Set(cards.map((c) => c.id));
|
||||
g.deck = g.deck.filter((c) => !ids.has(c.id));
|
||||
g.discard = g.discard.filter((c) => !ids.has(c.id));
|
||||
for (const p of g.players) p.hand = p.hand.filter((c) => !ids.has(c.id));
|
||||
g.players[index].hand = cards;
|
||||
}
|
||||
Reference in new issue
Block a user