Skip to content

samsmithnz/CardGames

Repository files navigation

CardGames

CI/CD Coverage Status Current Release

A C# implementation of classic card games featuring clean architecture, testable logic, and a desktop user interface. This project demonstrates modern software development practices while providing entertaining and familiar card game experiences.

image

Project Overview

CardGames is designed to implement various classic card games (such as Solitaire, Poker, and others) with a focus on:

  • Clean Architecture: Core game logic is completely separated from UI code
  • Testable Design: All game logic is unit tested and easily verifiable
  • Modular Structure: Each game variant is modular and reusable
  • Desktop Experience: Rich WPF-based user interface for Windows

Project Structure

The solution is organized into three main projects:

  • CardGames.Core (.NET Standard 2.1): Contains the core game logic, card definitions, deck management, and game rules
  • CardGames.Tests (.NET 8.0): Comprehensive unit tests for all core functionality
  • CardGames.WPF (.NET 8.0 Windows): Windows Presentation Foundation UI using MVVM pattern

Current Features

  • Card System: Complete playing card implementation with suits and numbers
  • Deck Management: Standard 52-card deck with shuffling capabilities
  • Solitaire Game: Full implementation of Klondike Solitaire with complete rule validation
  • Unit Testing: Comprehensive test coverage for all core functionality

Getting Started

Prerequisites

Building the Project

# Clone the repository
git clone https://github.com/samsmithnz/CardGames.git
cd CardGames

# Build the solution
dotnet build src/CardGames.sln

# Run tests
dotnet test src/CardGames.Tests/CardGames.Tests.csproj

Running the Application

# Run the WPF application (Windows only)
dotnet run --project src/CardGames.WPF/CardGames.WPF.csproj

Game Rules

Solitaire (Klondike)

The repository includes a complete implementation of Klondike Solitaire. For detailed rules, setup instructions, and strategy tips, see the Solitaire Rules Documentation.

Key features:

  • Traditional 7-column tableau with alternating color placement
  • 4 foundation piles building from Ace to King by suit
  • Stock and waste pile mechanics with automatic reset
  • Complete move validation and win condition checking

Technology Stack

  • Language: C#
  • Framework: .NET 8.0 / .NET Standard 2.1
  • UI Framework: Windows Presentation Foundation (WPF)
  • Testing: MSTest
  • CI/CD: GitHub Actions
  • Architecture Pattern: MVVM (for UI), Clean Architecture (overall)

Contributing

Contributions are welcome! Please ensure that:

  • All new public methods and classes include XML documentation
  • Unit tests are written for new functionality
  • Code follows the established C# conventions
  • UI logic remains separate from core game logic

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

POC to create a card game

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •