Beispiel #1
0
 public Puzzle AddBranch(string answer, string goTo)
 {
     PosibleBranches.Add(new AnswerToBranch
     {
         Answer = answer,
         GoToId = goTo
     });
     return(this);
 }
Beispiel #2
0
        public string GetNextPossibleBranchId(string answer)
        {
            var answerToBranches = PosibleBranches.FirstOrDefault(x =>
                                                                  string.Equals(x.Answer, answer, StringComparison.InvariantCultureIgnoreCase));

            if (answerToBranches != null)
            {
                return(answerToBranches.GoToId);
            }

            return(ElseBranch);
        }