feat: add TicTacToe example project

Implement a complete Tic-Tac-Toe game using OECS to demonstrate
ECS patterns, including:
- Command pattern for placing marks
- System groups for logical updates and rendering
- CSV loading for initial board state
- Reactivity logging for observing entity and component changes
This commit is contained in:
2026-07-18 20:43:13 +08:00
parent dddddbdbd6
commit a19861c080
14 changed files with 467 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
using MessagePack;
namespace TicTacToe;
/// <summary>
/// Identifies a board position. One entity per cell.
/// </summary>
[MessagePackObject]
public struct Cell
{
[Key(0)] public int Row;
[Key(1)] public int Col;
}
+13
View File
@@ -0,0 +1,13 @@
using MessagePack;
namespace TicTacToe;
/// <summary>
/// A mark placed on a cell by a player.
/// Only present on cells that have been claimed.
/// </summary>
[MessagePackObject]
public struct Mark
{
[Key(0)] public Player Player;
}
+8
View File
@@ -0,0 +1,8 @@
namespace TicTacToe;
public enum Player : byte
{
None = 0,
X = 1,
O = 2
}