2026-07-18 23:26:56 +08:00
|
|
|
using MessagePack;
|
|
|
|
|
using OECS;
|
|
|
|
|
|
2026-07-20 16:41:10 +08:00
|
|
|
namespace Game.Blackjack;
|
2026-07-18 23:26:56 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Player stands: advance to the dealer's turn.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MessagePackObject]
|
|
|
|
|
public struct StandCommand : ICommand
|
|
|
|
|
{
|
|
|
|
|
public void Execute(World world)
|
|
|
|
|
{
|
|
|
|
|
ref var state = ref world.GetSingleton<GameState>();
|
|
|
|
|
|
|
|
|
|
if (state.Phase != GamePhase.PlayerTurn)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
state.Phase = GamePhase.DealerTurn;
|
|
|
|
|
world.MarkModified<GameState>(World.SingletonEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|