Exemple #1
0
 public CardGameTableSpace AssignUser(CardGameUser user)
 {
     User = user;
     UserName = user.UserName;
     return AssignPile(user.Cards);
 }
Exemple #2
0
 public void DeclareWinner(CardGameUser user)
 {
     cardGameDelegates.DeclareWinnerCallback(user);
     //            Fiber<FiberYieldResponse>.Yield(new FiberYieldResponse(FiberYieldResponseType.GameOver));
 }
Exemple #3
0
 public CardGameQuestion(CardGameUser user, string question, string[] answers, GameCardGame cardGame)
 {
     User = user;
     Question = question;
     Answers = answers;
     CardGame = cardGame;
 }
Exemple #4
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;
        }