コード例 #1
0
        public IList <HangmanModel> InitializeQuestions(HangmanParameters param)
        {
            var questionsIds = GamesService.InitializeGame(param.DictionaryId, param.UserId, GamesEnum.Hangman, param.MaxNumberOfQuestions);
            var ids          = questionsIds.Select(x => x.TranslationId).ToList();
            var translations = GamesService.GetTranslationsById(ids, param.ReverseLangs);

            return(GetQuestions(translations, questionsIds));
        }
コード例 #2
0
        public ActionResult InitializeHangmanGame([FromBody] HangmanParameters param)
        {
            AccessGuardian(Roles.AccessUser, param.UserId);

            return(JsonHelper.Success(HangmanService.InitializeQuestions(param)));
        }