Framework to develop card games in .NET
The solution contains:
| Project | Description |
|---|---|
| Carubbi.Cards | Core framework: Card, CardSet, Deck, Suit (.NET 10) |
| Carubbi.Cards.WinForms | WinForms controls: CardBox, CardSetPanel + card image resources |
| Carubbi.BlackJack | Blackjack game logic over the core |
| Carubbi.BlackJack.UI | Blackjack UI (follows the project template standard) |
| Carubbi.SlotCard | Video poker machine logic |
| Carubbi.SlotCard.UI | Video poker machine UI |
| Carubbi.RobaMonte | "Roba Monte" deck-stealing game logic |
| Carubbi.RobaMonte.UI | "Roba Monte" UI (split from the former monolith) |
| Carubbi.Sabao | "Sabão" game (logic + UI) |
| CardGameProjectTemplate | Starter template for new games |
Test projects pair with their assembly: Carubbi.Cards.Tests, Carubbi.BlackJack.Tests, Carubbi.RobaMonte.Tests — all TUnit.
- .NET 10 SDK (or newer)
dotnet build Carubbi.Cards.slnx
dotnet run --project Carubbi.Cards.Tests
dotnet run --project Carubbi.BlackJack.Tests
dotnet run --project Carubbi.RobaMonte.Tests
CI runs build + all test suites on every push/PR (.github/workflows/ci.yml).
| Script | What it does |
|---|---|
scripts/run-coverage.ps1 |
Runs all *.Tests projects with coverage (MTP code coverage), one cobertura file per suite in TestResults/coverage/. -Report merges them into a single HTML report (ReportGenerator); -Open opens it. Pass -TestProjects <paths> to restrict. |
scripts/run-mutation-tests.ps1 |
Runs Stryker per logic assembly (Carubbi.Cards, Carubbi.BlackJack, Carubbi.RobaMonte) against its paired test project, using the MTP test runner. Installs dotnet-stryker on first use. Reports: TestResults/mutation/<Project>/. -Open opens the last report. |
Package versions are centralized in Directory.Packages.props (CPM); shared build settings in Directory.Build.props.
Decksupports an optional injectableRandom(new Deck(1, true, myRandom)) and a reproducible seeded shuffle viaShuffle(int seed);Deck.GameNumberidentifies the current game/shuffle.CardSet.Draw(index)removes and returns the card at an index (throws when out of range);GetTop/GetBottomreturnnullwhen empty.- Card face images live in
Carubbi.Cards.WinForms(CardImages.GetImage(card),ImageKeyonCard), keeping the core free of System.Drawing.