How weedbox/pokerface works
Project type and purpose
• pokerface is a Go‑based poker game engine library.
• It provides all the core logic to simulate poker games: deck management, dealing, action order, hand evaluation, pot handling, player settlement, match orchestration, and higher‑level competition flows.
• It is intended to be embedded in other applications (e.g., bots, servers) or used stand‑alone for testing poker rules.
File structure
• Top‑level files (action.go, deck.go, event.go, game.go, pokerface.go, etc.) define the core domain objects and main entry point.
• Domain sub‑packages:
• combination: card, hand evaluation
• pot: pot construction and side‑pots
• settlement:-ranking and payout settlement
• regulator: gameplay rules enforcement
• seat_manager: seat allocation
• Orchestration sub‑packages:
• match: single poker match runner, seat queue, table backend
• competition: higher‑level tournament or match sequences, state management
• actor: adapter interfaces & runners for automated/bot players
• table: abstractions for in‑memory or native backends to hold table state
• Configuration and extension points via adapters (native_table_adapter, table_engine_adapter) for pluggable table backends.
README
• Core Engine
• Game Controller (game.go, game_state.go, game_options.go)
• Event Dispatcher (event.go)
• Domain Logic
• Combination Engine (combination/)
• Pot Manager (pot/)
• Settlement Engine (settlement/)
• Regulator (regulator/)
• Seat Manager (seat_manager/)
• Match Layer
• Match Runner & Queue (match/)
• Competition Layer
• Competition Manager (competition/)
• Adapters & Interfaces
• Table Backends (table/, actor/native_table_adapter.go, adapter.go)
• Bot/Observer Runners (actor/)
• External Integrations
• Bot processes, test harnesses, external UI or API servers (not included but you’d plug in here)
• Game Controller calls Regulator → updates Table Backend → emits Events
• Event Dispatcher notifies Match Runner → triggers Pot Manager & Settlement at showdown
• Match Runner uses Seat Manager to add/remove players
• Competition Manager sequences multiple Match Runners
• Combination Engine invoked by Settlement & Regulator for hand ranking
• Adapters implement Table Backend interface, injecting into Match Runner
c. Architectural patterns & design principles
• Layered architecture: Domain → Match → Competition
• Dependency inversion: table backends & actor runners are injected via adapters
• Single Responsibility: each package handles one area (hand evaluation, pot, settlement)
• Domain‑driven: domain objects (Action, Player, Table, Pot, Rank)
d. Key technologies/frameworks
• Go modules (go.mod)
• Built‑in testing framework ( *_test.go files)
• Interface‑based adapters for pluggability