public async Task PickupFromDiscardAsync(IDeckDict <RegularRummyCard> thisCol) { var thisCard = thisCol.First(); _gameContainer.PreviousCard = thisCard.Deck; _model !.DiscardList1 !.RemoveFromPoint(thisCard.Deck); thisCol.ForEach(tempCard => { tempCard.Drew = true; }); SingleInfo !.MainHandList.AddRange(thisCol); SaveRoot !.MoreThanOne = thisCol.Count > 1; if (SingleInfo.PlayerCategory == EnumPlayerCategory.Self) { SortCards(); } _gameContainer.AlreadyDrew = true; //this counts as already drawing too. await ContinueTurnAsync(); }
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(); }