Exemple #1
0
        public void VoteAsCorrect(string username)
        {
            Game   game   = _triviaService.GetCurrentGame(Context.ConnectionId);
            Player player = _triviaService.GetPlayer(game, username);

            player.VotesAsCorrectNum++;

            if (player.VotesAsCorrectNum >= player.VotesAsCorrectDenom)
            {
                player.Score            += 10;
                player.LastAnswerCorrect = true;
            }

            SendDataToPlayers(game, "gameStateChange", game);
        }