/// <summary>The get problem.</summary> /// <param name="currentProblem">The current problem.</param> /// <param name="options">The options.</param> /// <param name="currentOption">The current option.</param> /// <returns>The <see cref="Problem"/>.</returns> private Problem GetProblem(Model.Problem currentProblem, IList <int> options, int currentOption) { Option option = currentProblem.Options.First(opt => opt.Number == options[currentOption]); // Todo: Check for conditions here. Route route = option.Routes.First(); Model.Problem nextProblem = route.NextProblem; currentOption = currentOption + 1; if (currentOption >= options.Count) { var problem = Mapper.Map <Problem>(nextProblem); return(problem); } return(this.GetProblem(nextProblem, options, currentOption)); }
public void OptionValidatorTest() { var optionValidator = new OptionValidator(); var option = new Option(); ValidationResults result = optionValidator.Validate(option); }
/// <summary>The make example step 1 problem 1 option 1.</summary> /// <param name="nextProblem">The next problem.</param> /// <returns>The <see cref="Option"/>.</returns> private static Option MakeExampleStep1Problem1Option1(Problem nextProblem) { var option = new Option { Number = 1, Text = "Grab the knife." }; var routes = MakeExampleStep1Problem1Option1Routes(nextProblem); foreach (var route in routes) { option.Routes.Add(route); } return option; }
/// <summary>The make example step 2 problem 2 option 2.</summary> /// <param name="nextProblem">The next problem.</param> /// <returns>The <see cref="Option"/>.</returns> private static Option MakeExampleStep2Problem2Option2(Problem nextProblem) { var option = new Option { Number = 2, Text = "Call for help." }; var routes = MakeExampleStep2Problem2Option2Routes(nextProblem); foreach (var route in routes) { option.Routes.Add(route); } return option; }
/// <summary>The make example step 2 problem 2 option 1.</summary> /// <param name="nextProblem">The next problem.</param> /// <returns>The <see cref="Option"/>.</returns> private static Option MakeExampleStep2Problem2Option1(Problem nextProblem) { var option = new Option { Number = 1, Text = "Throw the knife at the man." }; var routes = MakeExampleStep2Problem2Option1Routes(nextProblem); foreach (var route in routes) { option.Routes.Add(route); } return option; }
/// <summary>The make example step 1 problem 1 option 2.</summary> /// <param name="nextProblem">The next problem.</param> /// <returns>The <see cref="Option"/>.</returns> private static Option MakeExampleStep1Problem1Option2(Problem nextProblem) { var option = new Option { Number = 2, Text = "Hide behind the crates." }; var routes = MakeExampleStep1Problem1Option2Routes(nextProblem); foreach (var route in routes) { option.Routes.Add(route); } return option; }