refactor: reorganize project structure and move examples

- Move examples (Blackjack, TicTacToe) to the root directory
- Convert example projects from Console applications to Libraries
- Add Directory.Build.props for shared build settings
- Update solution file and project references to reflect new paths
This commit is contained in:
2026-07-20 16:30:02 +08:00
parent 5594515a53
commit 7946f4bafd
80 changed files with 61 additions and 549 deletions
+14
View File
@@ -0,0 +1,14 @@
using MessagePack;
namespace Blackjack;
/// <summary>
/// A playing card with a suit and rank.
/// One entity per card.
/// </summary>
[MessagePackObject]
public struct Card
{
[Key(0)] public Suit Suit;
[Key(1)] public Rank Rank;
}
+9
View File
@@ -0,0 +1,9 @@
using MessagePack;
namespace Blackjack;
/// <summary>
/// Tag component marking the dealer's hand entity.
/// </summary>
[MessagePackObject]
public struct DealerHand { }
+9
View File
@@ -0,0 +1,9 @@
using MessagePack;
namespace Blackjack;
/// <summary>
/// Tag component marking the deck entity.
/// </summary>
[MessagePackObject]
public struct Deck { }
+15
View File
@@ -0,0 +1,15 @@
using MessagePack;
using OECS;
namespace Blackjack;
/// <summary>
/// Relationship from a hand entity to a card entity,
/// representing that the hand holds this card.
/// </summary>
[MessagePackObject]
public struct Holds : IRelationship
{
[Key(0)] public Entity Source { get; set; }
[Key(1)] public Entity Target { get; set; }
}
+15
View File
@@ -0,0 +1,15 @@
using MessagePack;
using OECS;
namespace Blackjack;
/// <summary>
/// Relationship from a card entity to the deck entity,
/// representing that the card is in the deck.
/// </summary>
[MessagePackObject]
public struct InDeck : IRelationship
{
[Key(0)] public Entity Source { get; set; }
[Key(1)] public Entity Target { get; set; }
}
+9
View File
@@ -0,0 +1,9 @@
using MessagePack;
namespace Blackjack;
/// <summary>
/// Tag component marking the player's hand entity.
/// </summary>
[MessagePackObject]
public struct PlayerHand { }
+18
View File
@@ -0,0 +1,18 @@
namespace Blackjack;
public enum Rank : byte
{
Ace = 1,
Two = 2,
Three = 3,
Four = 4,
Five = 5,
Six = 6,
Seven = 7,
Eight = 8,
Nine = 9,
Ten = 10,
Jack = 11,
Queen = 12,
King = 13
}
+9
View File
@@ -0,0 +1,9 @@
namespace Blackjack;
public enum Suit : byte
{
Clubs = 0,
Diamonds = 1,
Hearts = 2,
Spades = 3
}