public async Task StartGame(PlayerType dealer, Deck deck) { _dealer = dealer; _game.NewGame(_dealer, deck); // // 2 stats when you start a game. GameStarted, and who won the deal. if you play 1,000 games, how many times will you deal? MainPage.Current.StatsView.Stats.Stat(StatName.GamesStarted).UpdateStatistic(PlayerType.Player, 1); MainPage.Current.StatsView.Stats.Stat(StatName.WonDeal).UpdateStatistic(dealer, 1); await SetState(GameState.Deal); }
private async Task AddScoreCollectionToHistory() { LocalGame game = new LocalGame(); game.NewGame(PlayerType.Computer, MainPage.Current.Deck); HandsFromServer hfs = game.ShuffleAndReturnAllCards(); List <CardView> crib = game.GetSuggestedCrib(PlayerType.Player, GameDifficulty.Hard); game.SendToCrib(PlayerType.Computer, crib); hfs.PlayerCards.Remove(crib[0]); hfs.PlayerCards.Remove(crib[1]); int scoreGuess = game.GetScore(PlayerType.Player, HandType.Regular); ScoreCollection scores = game.UpdateScore(PlayerType.Player, HandType.Regular, scoreGuess, GameDifficulty.Hard); List <CardView> cards = new List <CardView>(hfs.PlayerCards); _gridDeck.Items.Remove(hfs.SharedCard); _gridDeck.Items.Insert(0, hfs.SharedCard); await _view.AddToScoreHistory(cards, scores, PlayerType.Player); }