Veggerby.Boards 0.1.0-prerelease0161

This is a prerelease version of Veggerby.Boards.
dotnet add package Veggerby.Boards --version 0.1.0-prerelease0161
                    
NuGet\Install-Package Veggerby.Boards -Version 0.1.0-prerelease0161
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Veggerby.Boards" Version="0.1.0-prerelease0161" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Veggerby.Boards" Version="0.1.0-prerelease0161" />
                    
Directory.Packages.props
<PackageReference Include="Veggerby.Boards" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Veggerby.Boards --version 0.1.0-prerelease0161
                    
#r "nuget: Veggerby.Boards, 0.1.0-prerelease0161"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Veggerby.Boards@0.1.0-prerelease0161
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Veggerby.Boards&version=0.1.0-prerelease0161&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Veggerby.Boards&version=0.1.0-prerelease0161&prerelease
                    
Install as a Cake Tool

Veggerby.Boards

Immutable, deterministic board game engine primitives: artifacts (Board, Tile, Piece, Player, Dice), immutable GameState history chain, declarative events, rules, phases, and safe transition execution.

This is the foundational package. Other domain/game modules (Chess, Backgammon) sit on top without extending internal mutable state.

Install

 dotnet add package Veggerby.Boards

When To Use

Use this package when you need to:

  • Model a turn/phase based board game with deterministic replay
  • Express moves as intent (IGameEvent) separated from validation and mutation
  • Maintain a full immutable history for branching / analysis / undo
  • Compose rules and phases declaratively

If you only need a ready-made game (e.g., Chess) and won't build custom rules, reference the game module package instead (it transitively references Core).

Quick Start

// Build a custom game (example sketch)
var builder = new GameBuilder("my-game");
// builder.AddBoard(...).AddPlayers(...).AddPieces(...).AddRules(...)
var progress = builder.Compile();

// Issue a move event (pseudo—depends on your defined artifacts)
var piece = progress.Game.GetPiece("white-pawn-2");
var from = progress.Game.GetTile("e2");
var to = progress.Game.GetTile("e4");
var pathVisitor = new ResolveTilePathPatternVisitor(progress.Game.Board, from, to);
var updated = progress.HandleEvent(new MovePieceGameEvent(piece, pathVisitor.ResultPath));

Core Concepts

Concept Summary
Artifact Immutable identity created only by GameBuilder
GameState Immutable snapshot linked to prior (persistent history)
GameProgress Facade carrying Game + current GameState + handling pipeline
IGameEvent Declarative intention (e.g., move piece, roll dice)
Rule Couples condition evaluation with deterministic mutator
Phase Conditional scope limiting which rules apply
Mutator Pure function returning a new GameState

Determinism & Purity

  • No randomness except through explicit dice artifacts and their state.
  • Same event + same state → same result. Always.
  • No hidden global or time-based influences.

Validation Pipeline (High Level)

  1. Submit IGameEvent
  2. Active phase filters applicable rules
  3. Rule conditions yield: Valid, Invalid, Ignore, NotApplicable
  4. First Valid rule's mutator executes producing new GameState
  5. New GameProgress returned (state chained)

Extending

Typical extension points:

  • New IGameEvent + corresponding mutator & rule
  • New pattern visitor for movement resolution
  • New composite condition types

Keep extensions explicit and side-effect free.

Versioning

Semantic versioning aligned with repository releases. Breaking API changes bump MAJOR.

Roadmap (Selected)

  • Decision plan executor (optimized rule dispatch)
  • Deterministic timeline hashing
  • Movement pattern compilation (DFA)
  • Optional bitboard acceleration (game-specific)

Contributing

Issues & PRs: https://github.com/veggerby/Veggerby.Boards

Follow repository contribution guidelines and style rules.

License

MIT License. See repository root LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Veggerby.Boards:

Package Downloads
Veggerby.Boards.Chess

Chess implementation components for Veggerby.Boards built atop the core engine.

Veggerby.Boards.Backgammon

Backgammon implementation components for Veggerby.Boards built atop the core engine.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-prerelease0161 51 9/26/2025
0.1.0-prerelease0160 49 9/26/2025
0.1.0-prerelease0159 55 9/26/2025
0.1.0-prerelease0158 62 9/26/2025
0.1.0-prerelease0157 149 9/21/2025
0.1.0-prerelease0156 150 9/21/2025