Skip to content

Stacks

Use a Stack for an ordered deck, draw pile, hand, or discard pile. You can draw, burn, discard, reset, or shuffle it. Use a Source for a shoe or draw pool that combines stacks and can apply reshuffle policies.

Ordering is represented by stable membership entry identities plus mergeable rank sidecars. A shuffle changes ranks rather than replacing the membership list. This preserves concurrent inserts, draws, placements, and removals as replicas merge. Documents using legacy container ordering must be migrated with Engine.migrateLegacyContainers() rather than lazily rewritten by a read.

For reproducible tests and controlled replay, shuffle actions accept an optional seed. A seed does not make unrelated game decisions or network arrival order deterministic; see Replay with seeds.