feat: implement CardWars game engine
Implement the core CardWars game logic using an ECS-based architecture. This includes: - Card effect registry and various card effect implementations. - Game phase management (Setup, Play, Flip, Scoring, Cleanup). - Command system for player actions (PlayCard, FlipCard, etc.). - Component-based game state and entity relationships. - Automated game setup and scoring systems. - Unit tests for game setup, card effects, and play logs.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Game.CardWars;
|
||||
|
||||
/// <summary>
|
||||
/// Global game state on the singleton entity.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public record struct GameState
|
||||
{
|
||||
[Key(0)] public GamePhase Phase;
|
||||
[Key(1)] public int PlayerCount;
|
||||
[Key(2)] public int CurrentPlayerIndex;
|
||||
[Key(3)] public int StartingPlayerIndex;
|
||||
[Key(4)] public int RoundNumber;
|
||||
[Key(5)] public uint Seed;
|
||||
[Key(6)] public bool PlayPhaseEnded;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Game.CardWars;
|
||||
|
||||
/// <summary>
|
||||
/// Per-player score tracking.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public record struct PlayerScores
|
||||
{
|
||||
[Key(0)] public int[] Scores;
|
||||
[Key(1)] public CastleColor[] WonCastles;
|
||||
[Key(2)] public int Count;
|
||||
}
|
||||
Reference in New Issue
Block a user