Beispiel #1
0
 public static void ShouldBe(this IChoiceOption option, string key, string text, bool isEnabled, string imageName, string helpText)
 {
     option.Key.Should().Be(key);
     option.Text.Should().Be(text);
     option.IsEnabled.Should().Be(isEnabled);
     option.ImageName.Should().Be(imageName);
     option.HelpText.Should().Be(helpText);
 }
Beispiel #2
0
        public bool Choose(IChoiceOption choice, IPlayerContext ctx)
        {
            if (choice == null || ctx == null)
            {
                throw new ArgumentNullException("one paramter is null but can't !");
            }

            if (!Choices.Any(c => c.Text == choice.Text))
            {
                return(false);
            }
            if (!choice.CanChoose(ctx))
            {
                return(false);
            }

            CurrentChoice = choice;
            return(true);
        }
Beispiel #3
0
 public ChoiceOptionMV(IChoiceOption option)
     : base(option)
 {
 }