Veggerby.Boards 0.1.0-prerelease0157

This is a prerelease version of Veggerby.Boards.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Veggerby.Boards --version 0.1.0-prerelease0157
                    
NuGet\Install-Package Veggerby.Boards -Version 0.1.0-prerelease0157
                    
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-prerelease0157" />
                    
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-prerelease0157" />
                    
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-prerelease0157
                    
#r "nuget: Veggerby.Boards, 0.1.0-prerelease0157"
                    
#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-prerelease0157
                    
#: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-prerelease0157&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Veggerby.Boards&version=0.1.0-prerelease0157&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 (3)

Showing the top 3 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.

Veggerby.Boards.Go

Veggerby.Boards Go module: immutable Go board (configurable size), stone placement & pass events scaffolding.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-prerelease0164 40 10/5/2025
0.1.0-prerelease0163 40 10/5/2025
0.1.0-prerelease0162 114 10/2/2025
0.1.0-prerelease0161 65 9/26/2025
0.1.0-prerelease0160 64 9/26/2025
0.1.0-prerelease0159 68 9/26/2025
0.1.0-prerelease0158 74 9/26/2025
0.1.0-prerelease0157 151 9/21/2025
0.1.0-prerelease0156 152 9/21/2025