To design a poker game engine that supports multiple variants (Texas Hold'em, Omaha, Short Deck, OFC) without code duplication, you must adopt a Component-Based Architecture driven by a Strategy Pattern for variant-specific logic. The core engine handles universal game flow (deal, betting rounds, pot management, side pots), while variant-specific rules are injected as pluggable modules.
Core Architecture: The "Universal Engine" Pattern
The fundamental challenge is separating game state from game rules. The engine should treat a "Hand" as a generic sequence of actions and cards, while a "Variant Controller" interprets those actions based on specific rules.
1. The Domain Model (Shared Layer)
This layer contains entities common to all poker variants. These are immutable data structures or state machines that never change regardless of the variant.








