private async Task AnimateCribCardsToOwner(PlayerType owner) { CardContainer cribOwner = GridPlayer; if (owner == PlayerType.Computer) { cribOwner = GridComputer; } List <Task <Object> > tasks = new List <Task <object> >(); // // return player and computer cards to the deck GridPlayer.FlipAllCards(CardOrientation.FaceDown, tasks); GridPlayer.MoveAllCardsToTarget(GridDeck, tasks, MainPage.AnimationSpeeds.Medium, true); GridComputer.FlipAllCards(CardOrientation.FaceDown, tasks); GridComputer.MoveAllCardsToTarget(GridDeck, tasks, MainPage.AnimationSpeeds.Medium, true); // // move crib cards back to player GridCrib.MoveAllCardsToTarget(cribOwner, tasks, MainPage.AnimationSpeeds.Medium, true); cribOwner.FlipAllCards(CardOrientation.FaceUp, tasks); await Task.WhenAll(tasks); }
public async Task OnEndOfHand(PlayerType dealer, int cribScore, int nComputerCountingPoint, int nPlayerCountingPoint, int ComputerPointsThisTurn, int PlayerPointsThisTurn) { CardContainer cribOwner = GridPlayer; if (dealer == PlayerType.Computer) { cribOwner = GridComputer; } await HintWindow.InsertEndOfHandSummary(dealer, cribScore, cribOwner.Items, nComputerCountingPoint, nPlayerCountingPoint, ComputerPointsThisTurn, PlayerPointsThisTurn, Hfs); List <Task <Object> > tasks = new List <Task <object> >(); cribOwner.FlipAllCards(CardOrientation.FaceDown, tasks); cribOwner.MoveAllCardsToTarget(GridDeck, tasks, MainPage.AnimationSpeeds.Medium, true); await Task.WhenAll(tasks); }