Exemplo n.º 1
0
 public void Reset2New()
 {
     HideAllButtons();
     TilesFlowerList.Clear();
     TilesHandList.Clear();
     MeldList.Clear();
     BankerChairId       = 0;
     TbRichi.Text        = "";
     TbPseudoFlower.Text = "";
 }
        protected override async Task LastPartOfSetUpBeforeBindingsAsync()
        {
            if (IsLoaded == false)
            {
                SingleInfo = PlayerList !.GetSelf();
                Aggregator.Subscribe(SingleInfo);
                SingleInfo = PlayerList.GetWhoPlayer(); //i think.
            }
            LoadControls();
            LoadVM();
            SaveRoot !.MeldList.Clear();
            SaveRoot.CardList.Clear();
            SaveRoot.TrumpSuit = _model.Pile1 !.GetCardInfo().Suit;
            _aTrick !.ClearBoard(); //try this too.
            PlayerList !.ForEach(thisPlayer =>
            {
                thisPlayer.TricksWon    = 0;
                thisPlayer.CurrentScore = 0;
            });
            var thisCard = _model.Pile1.GetCardInfo();

            if (thisCard.Value == EnumCardValueList.Nine)
            {
                int player = WhoStarts;
                if (player == 1)
                {
                    player = 2;
                }
                else
                {
                    player = 1;
                }
                MeldClass thisMeld = new MeldClass();
                thisMeld.Player      = player;
                thisMeld.ClassAValue = EnumClassA.Dix;
                SaveRoot.MeldList.Add(thisMeld);
                var tempPlayer = PlayerList[player];
                SaveRoot.StartMessage = $"{tempPlayer.NickName} gets an exta 10 points because the discard to begin with is a dix and is not going first";
                CalculateScore(player);
                await UIPlatform.ShowMessageAsync(SaveRoot.StartMessage);
            }
            await base.LastPartOfSetUpBeforeBindingsAsync();
        }