How tom-ludwig/allinorfold works
Project Type and Purpose
• This is a single‐module Kotlin command-line application (educational student project) that implements the core mechanics of a poker game (“AllInOrFold”).
• It uses Maven as build tool, GitHub Actions for CI (lint/format checks and unit tests), and Just as a convenience wrapper for common Maven commands.
High-Level Architecture
The system can be represented in four main components:
• CLI & Entrypoint Layer
• Application Core (Game Orchestrator)
• Domain Model (Poker Entities)
• Infrastructure & Tooling (Build, CI/CD, Tests)
Components and Relationships
A. CLI & Entrypoint Layer
• Contains the main() function that initializes and runs the poker game.
• Parses user input (e.g., number of players, actions: fold/call/all-in).
• Invokes the Game Orchestrator.
B. Application Core (Game.kt)
• Coordinates gameplay: shuffles the Deck, deals to Players, advances Rounds, evaluates hands.
• Holds references to Deck, Players, and Round objects.
• Exposes public methods like startGame(), nextRound() which the CLI calls.
C. Domain Model (in package hwr.oop.group1.poker)
• Card, CardSuit, CardRank: immutable value objects.
• Player: holds hand (list of Card) and state (chips, status).
• Round: manages bets, community cards, tracks current pot.
• HandType & HandRank: logic to evaluate and compare poker hands.
D. Infrastructure & Tooling
• pom.xml / .mvn: Maven project configuration.
• justfile: shortcut commands for build/test.
• .github/workflows: GitHub Actions for lint/format and unit-test CI pipelines.
• src/test: JUnit tests for each domain and core component.
Architectural Patterns and Principles
• Layered Architecture:
– Presentation (CLI)
– Application (Game orchestrator)
– Domain (Entities & business logic)
– Infrastructure (build & CI)
• Package-By-Feature: all poker logic lives under a single feature package.
• Dependency Direction: Outer layers depend on inner layers (CLI depends on Core; Core depends on Domain).
• Notes on external tools (Maven, Just, GitHub Actions).