Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 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);
 }
Esempio n. 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();
 }
Esempio n. 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();
 }
Esempio n. 6
0
 public abstract IEnumerable<int> ChooseEffects(EffectChoiceType choiceType, IEnumerable<CardModel> cardInfo, string choiceText, int minChoices, int maxChoices, string[] choices, string[] choiceDescriptions);
Esempio n. 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;
 }
Esempio n. 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);
 }