Example #1
0
 public override IEnumerable<int> ChooseEffects(EffectChoiceType choiceType, IEnumerable<CardModel> cardInfo, string choiceText, int minChoices, int maxChoices, string[] choices, string[] choiceDescriptions)
 {
     maxChoices = Math.Min(maxChoices, choices.Count());
     int howMany = Randomizer.Next(minChoices, maxChoices + 1);
     List<int> indexes = new List<int>();
     for (int i = 0; i < choices.Count(); i++)
     {
         indexes.Add(i);
     }
     return indexes.OrderBy(c => Randomizer.Next()).Take(howMany);
 }
Example #2
0
 protected int Overpay(GameModel gameModel, EffectChoiceType effectChoiceType, string choiceDescription)
 {
     int max = gameModel.CurrentPlayer.Coin;
     if (max > 0)
     {
         string[] choices = new string[max + 1];
         for (int i = 0; i <= max; i++)
         {
             choices[i] = i.ToString();
         }
         int result = gameModel.CurrentPlayer.Chooser.ChooseOneEffect(effectChoiceType, choiceDescription, choices, choices);
         gameModel.CurrentPlayer.AddActionCoin(-result);
         return result;
     }
     return 0;
 }
Example #3
0
 public IEnumerable<int> ChooseSeveralEffects(EffectChoiceType choiceType, IEnumerable<CardModel> cardInfo, string choiceText, int minChoices, int maxChoices, string[] choices, string[] choiceDescriptions)
 {
     return this.ChooseEffects(choiceType, cardInfo, choiceText, minChoices, maxChoices, choices, choiceDescriptions);
 }
Example #4
0
 public int ChooseOneEffect(EffectChoiceType choiceType, string choiceText, string[] choices, string[] choiceDescriptions)
 {
     return this.ChooseEffects(choiceType, new CardModel[] { }, choiceText, 1, 1, choices, choiceDescriptions).First();
 }
Example #5
0
 public int ChooseOneEffect(EffectChoiceType choiceType, IEnumerable<CardModel> cardInfo, string choiceText, string[] choices, string[] choiceDescriptions)
 {
     return this.ChooseEffects(choiceType, cardInfo, choiceText, 1, 1, choices, choiceDescriptions).First();
 }
Example #6
0
 public abstract IEnumerable<int> ChooseEffects(EffectChoiceType choiceType, IEnumerable<CardModel> cardInfo, string choiceText, int minChoices, int maxChoices, string[] choices, string[] choiceDescriptions);
Example #7
0
 public override IEnumerable<int> ChooseEffects(EffectChoiceType choiceType, IEnumerable<CardModel> cardInfo, string choiceText, int minChoices, int maxChoices, string[] choices, string[] choiceDescriptions)
 {
     List<int> ret = new List<int>();
     for (int i = 0; i < minChoices; i++)
     {
         ret.Add(i);
     }
     return ret;
 }
Example #8
0
 public override IEnumerable<int> ChooseEffects(EffectChoiceType choiceType, IEnumerable<CardModel> cardInfo, string choiceText, int minChoices, int maxChoices, string[] choices, string[] choiceDescriptions)
 {
     IEnumerable<string> chosen = this.MakeEffectChoice(choiceText, minChoices, maxChoices,choices, choiceDescriptions);
     return from c in chosen select Array.IndexOf(choices, c);
 }