public UserSettingsViewModel()
 {
     UpdateUserUCViewModel  = new UpdateUserUCViewModel();
     DeleteUserUCViewModel  = new DeleteUserUCViewModel();
     SendMessageUCViewModel = new SendMessageUCViewModel();
     PlayerStatsUCViewModel = new PlayerStatsUCViewModel();
 }
Пример #2
0
        public GameEndViewModel(Game game, string word)
        {
            _highscoreRepository = new HighscoreRepository();

            Title      = game.IsWon ? _winTitle : _lossTitle;
            TitleColor = game.IsWon ? "Green" : "Red";

            IncorrectGuesses = $"Antal felgissningar: {game.NumberOfIncorrectTries}";
            TotalTime        = "Tid: " + (game.EndTime - game.StartTime).ToString(@"mm\:ss\.ff");
            Word             = word.ToUpper();

            if (game.Id != 0)
            {
                PlayerStatsBoolToVis = true;
                PlayerStatsViewModel = new PlayerStatsUCViewModel();

                if (game.IsWon)
                {
                    var gameRanking = _highscoreRepository.GetRankOnHighScore(game.Id);
                    GameRankDisplay = $"Du kom på plats: {gameRanking}";
                }
            }
        }