Example #1
0
        private void OnTurnUpdated(Turn turn)
        {
            var game = GetGameFromCache(turn.GameId);
            if (game != null)
            {
                if (game.IsCurrentUserTurn()
                    && game.CurrenTurn.Id == turn.Id)
                {
                    if (turn.FinishedAt.HasValue
                        && game.CurrenTurn.FinishedAt == null)
                    {
                        if (turn.DidTurnEarnPoints() && App.SyncedSettings.NotifyPointsEarned)
                        {
                            App.ToastMaker.ShowToast($"You just earned {turn.Points} points!", game.Name);
                        }
                        else if (turn.SubmitType.WasSkipped())
                        {
                            App.ToastMaker.ShowToast("You were just skipped in", game.Name);
                        }
                    }
                    else if (turn.SubmittedAt.HasValue
                        && game.CurrenTurn.SubmittedAt == null
                        && turn.SubmitType == SubmitType.WindowsSubmitted)
                    {
                        if (game.IsCurrentUserTurnAndNotSubmitted())
                        {
                            App.ToastMaker.ShowToast("Submitted GameSave File", game.Name);
                        }
                    }

                    GetDataForGameAsync(game);
                }
            }
        }
Example #2
0
 private void OnTurnChanged(Turn turn)
 {
     var game = GetGameFromCache(turn.GameId);
     if (game != null)
     {
         GetDataForGameAsync(game);
     }
 }