Example #1
0
        private void ToStreet(object obj)
        {
            if (obj == null)
            {
                return;
            }

            StopTimer(null);

            if (Enum.TryParse(obj.ToString(), out Street outStreet))
            {
                var streetState = TableStateList.FirstOrDefault(x => x.CurrentStreet == outStreet);

                if (streetState != null)
                {
                    if (outStreet <= Street.Preflop)
                    {
                        PlayersCollection.Where(x => x.IsFinished && TableStateList.Any(t => t.ActivePlayer.Name == x.Name)).ForEach(x => x.IsFinished = false);
                    }

                    StateIndex = TableStateList.IndexOf(streetState);

                    UpdatePlayersEquityWin(TableStateList.FirstOrDefault(x => x.CurrentStreet == outStreet)); //update equity win property of all players
                }
            }
        }
Example #2
0
        private void ToStart(object obj)
        {
            StopTimer(null);

            PlayersCollection.Where(x => x.IsFinished && TableStateList.Any(t => t.ActivePlayer.Name == x.Name)).ForEach(x => x.IsFinished = false);
            StateIndex = 0;
        }
Example #3
0
        private void ToEnd(object obj)
        {
            StopTimer(null);

            ResetPlayersPot(PlayersCollection);
            PlayersCollection.Where(x => !x.IsFinished && TableStateList.Any(t => t.ActivePlayer.Name == x.Name && t.ActivePlayer.IsFinished)).ForEach(x => x.IsFinished = true);
            StateIndex = TableStateList.Count - 1;

            ReplayerTableState replayerTableStateBeforeSummary = TableStateList.FirstOrDefault(x => x.CurrentStreet == Street.Summary);

            UpdatePlayersEquityWin(replayerTableStateBeforeSummary); //added in order to update equity state for winning actions when we go to the end of TableStateList
        }
Example #4
0
        //public void SelectedPlayers()
        //{
        //    _mvxMessenger.Publish<SelectedPlayersMessage>(new SelectedPlayersMessage(this, PlayersCollection));
        //}

        void SelectedPlayer(PlayerViewModel player)
        {
            player.IsSelected = !player.IsSelected;

            if (PlayersCollection.Where(p => p.IsSelected).Count() > 0)
            {
                IsPlayerSelected = true;
                Title            = string.Format("{0} selected", PlayersCollection.Where(p => p.IsSelected).Count());
            }
            else
            {
                IsPlayerSelected = false;
                Title            = "Players";
            }
        }