Esempio n. 1
0
        public int AskQuestion(CardGameUser user, string question, string[] answers, GameCardGame cardGame)
        {
            cardGame.Emulating = false;
            if (cardGame.EmulatedAnswers.Count - 1 > cardGame.EmulatedAnswerIndex)
            {
                cardGame.Emulating = true;
                return(cardGame.EmulatedAnswers[cardGame.EmulatedAnswerIndex++].Value); //todo .value
            }

            var m      = new CardGameQuestion(user, question, answers, cardGame);
            var answer = cardGameDelegates.AskQuestionCallback(m);

            cardGame.EmulatedAnswerIndex++;
            return(answer == null ? 0 : answer.Value);
        }
Esempio n. 2
0
        public int AskQuestion(CardGameUser user, string question, string[] answers, GameCardGame cardGame)
        {
            cardGame.Emulating = false;
            if (cardGame.EmulatedAnswers.Count - 1 > cardGame.EmulatedAnswerIndex)
            {
                cardGame.Emulating = true;
                return cardGame.EmulatedAnswers[cardGame.EmulatedAnswerIndex++].Value; //todo .value
            }

            var m = new CardGameQuestion(user, question, answers, cardGame);
            var answer= cardGameDelegates.AskQuestionCallback(m);
            cardGame.EmulatedAnswerIndex++;
            return answer == null ? 0 : answer.Value;
        }