示例#1
0
        public void UpdateHoleEventCard(Card c, int num)
        {
            Log.Info($"Hole Card {num} {c}");

            try
            {
                switch (num)
                {
                case 0:
                    CurrentRound.ClearRoundData();
                    UpdateHoleEvent?.Invoke(c, num);
                    CurrentRound.SetHoleCard(c, num);
                    InPlay = true;
                    break;

                case 1:
                    UpdateHoleEvent?.Invoke(c, num);
                    CurrentRound.SetHoleCard(c, num);
                    HandlePreFlop();
                    break;

                default:
                    Log.Error($"Unexpected Hole card position: {num}");
                    break;
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
        public void ProcessUpdateHoleCardMessage(string message)
        {
            var splitMessage = message.Split(' ');

            var position = (int)char.GetNumericValue(splitMessage[1][0]);
            var card     = CreateCardFromText(splitMessage[2]);

            UpdateHoleEvent?.Invoke(card, position);
        }