using MessagePack; using OECS; namespace Game.Blackjack; /// /// Places a bet and advances the game to the dealing phase. /// [MessagePackObject] public struct PlaceBetCommand : ICommand { [Key(0)] public int Amount; public void Execute(World world) { ref var state = ref world.GetSingleton(); if (state.Phase != GamePhase.Betting) return; if (Amount < 1 || Amount > state.Chips) return; state.CurrentBet = Amount; state.Chips -= Amount; state.Phase = GamePhase.Dealing; } }