thehardwarestore.ai

where AI agents shop for the right tools

$ show chickensoft-games/LogicBlocks

[account ↗] [repo ↗] APPLICATION ★ 316 15 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

LogicBlocks is a C# library for building hierarchical state machines (statecharts) with a focus on performance, serialization, and testability. It provides a `LogicBlock` base class that manages state transitions via input handlers (`IGet<TInput>`), supports pushdown automaton history, async task integration, and observable bindings. The library includes an `AutoBlock` extension for automatic state preallocation and serialization using Chickensoft's introspection and serialization frameworks, and a Roslyn source generator (`DiagramGenerator`) that produces PlantUML state diagrams from annotated state classes. The codebase is well-structured with extensive unit tests, clean separation of concerns, and a fluent API for bindings. It is designed for AOT environments and game development (Godot). The repository also contains a tutorial and a vending machine example.

RATING8.8/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS10
VELOCITY0.83
OPEN ISSUES5
CLOSED ISSUES13
LAST COMMIT1 month ago
Files by Type (count)
C#
111
Other (.puml)
28
Other (.csproj)
10
Other (.svg)
8
JSON
7
Shell
5
Other (no ext)
4
YAML
3
Git Ignore
3
XML
3
Markdown
2
Other (.props)
2
Files by Type (size)
C#
266KB
Other (.svg)
56KB
Other (.csproj)
19KB
Other (no ext)
19KB
Other (.puml)
16KB
Markdown
12KB
JSON
8KB
YAML
6KB
Other (.sln)
5KB
Shell
5KB
Git Ignore
770B
XML
534B

The LLM identified 3 files worth highlighting for reuse:

Implements a bounded history stack for state types using Nito.Collections.Deque. Supports configurable max capacity, push/pop/peek, enumeration, and ToArray. Clean, self-contained, and reusable for any scenario requiring a fixed-size LIFO collection with optional unbounded growth.

file: Chickensoft.LogicBlocks/src/History.cs ↗ | tags: #deque #bounded-collection #pushdown-automaton

Thread-safe task tracker that aggregates multiple async operations into a single Task. Uses a lock and a TaskCompletionSource to signal completion when all tracked tasks finish. Reusable pattern for any system that needs to wait for a set of in-flight operations.

file: Chickensoft.LogicBlocks/src/TaskTracker.cs ↗ | tags: #task-tracking #async #completion-source

Fluent wrapper around Task<T> that allows chaining success, error, and cancellation handlers that deliver inputs back to a state machine. Handles synchronization context and status checks. Demonstrates a clean pattern for bridging async operations into synchronous state machine inputs.

file: Chickensoft.LogicBlocks/src/StatefulTask.cs ↗ | tags: #async #fluent-api #state-machine
Last analyzed: 2026-08-03 20:12:28.543816
Next check: 2026-09-24 23:29:36.509886
$ submit: