Example #1
0
        public override async Task StartNewTurnAsync()
        {
            PrepStartTurn(); //anything else is below.
            _model !.Pool1 !.NewTurn();
            SaveRoot !.TilesFromField.Clear();
            SaveRoot.BeginningList = _model.MainSets1 !.SavedSets();
            var firsts = PlayerHand();

            SaveRoot.YourTiles = firsts.GetDeckListFromObjectList();
            SaveRoot.DidExpand = false;
            await ContinueTurnAsync(); //most of the time, continue turn.  can change to what is needed
        }
Example #2
0
        public async Task RemoveTileFromSetAsync(int index, int deck)
        {
            SaveRoot !.TilesFromField.Add(deck);
            TileSet thisSet = _model !.MainSets1 !.GetIndividualSet(index);

            SaveRoot.DidExpand = true;
            var thisTile = _model.Pool1 !.GetTile(deck);

            thisTile.WhatDraw = EnumDrawType.FromSet;
            if (thisTile.IsJoker)
            {
                thisTile.Number = 20;
            }
            thisSet.HandList.RemoveObjectByDeck(deck);
            SingleInfo !.MainHandList.Add(thisTile);
            if (SingleInfo.PlayerCategory == EnumPlayerCategory.Self)
            {
                SingleInfo.MainHandList.Sort();
            }
            await ContinueTurnAsync();
        }
Example #3
0
        public async Task RemoveEntireSetAsync(int index)
        {
            TileSet thisSet  = _model !.MainSets1 !.GetIndividualSet(index); //looks like 0 based bug again  try a different method that is not 0 based.
            var     tempList = new DeckRegularDict <TileInfo>();

            thisSet.HandList.ForEach(thisTile =>
            {
                thisTile.WhatDraw = EnumDrawType.FromSet;
                SaveRoot !.TilesFromField.Add(thisTile.Deck);
                if (thisTile.IsJoker)
                {
                    thisTile.Number = 20;
                }
                tempList.Add(thisTile);
            });
            _model.MainSets1.RemoveSet(index - 1); //i think 0 based bug again.
            SingleInfo !.MainHandList.AddRange(tempList);
            if (SingleInfo.PlayerCategory == EnumPlayerCategory.Self)
            {
                SingleInfo.MainHandList.Sort();
            }
            await ContinueTurnAsync();
        }