public void ProcessUpdateBoardMessage(string message)
        {
            var splitMessage = message.Split(' ');

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

            UpdateBoardEvent?.Invoke(card, position);
        }
Exemple #2
0
        public void UpdateBoardEventCard(Card c, int num)
        {
            Log.Info($"Board Card {num} {c}");

            try
            {
                switch (num)
                {
                case 0:
                    if (CurrentRound.Hole[0].Rank != Rank.None)
                    {
                        Session.Statistics.HandsPlayed++;
                        UpdateHandsPlayedEvent?.Invoke(Session.Statistics.HandsPlayed);
                    }
                    CurrentRound.SetFlopCard(c, num);
                    UpdateBoardEvent?.Invoke(c, num);
                    return;

                case 1:
                    CurrentRound.SetFlopCard(c, num);
                    UpdateBoardEvent?.Invoke(c, num);
                    return;

                case 2:
                    CurrentRound.SetFlopCard(c, num);
                    UpdateBoardEvent?.Invoke(c, num);
                    HandleFlop();
                    return;

                case 3:
                    CurrentRound.SetTurnCard(c);
                    UpdateBoardEvent?.Invoke(c, num);
                    HandleTurn();
                    return;

                case 4:
                    CurrentRound.SetRiverCard(c);
                    UpdateBoardEvent?.Invoke(c, num);
                    HandleRiver();
                    return;

                default:
                    Log.Error($"Unexpected Board Card Position : {num}");
                    break;
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }