private void ObjectToForm(ShuffleRestrictions shuffleRestrictions)
 {
     checkBoxControls.Checked    = shuffleRestrictions.restrictControls;
     checkBoxShape.Checked       = shuffleRestrictions.restrictShape;
     numericUpDownControls.Value = shuffleRestrictions.controls;
     textBoxShape.Text           = shuffleRestrictions.shape;
 }
Пример #2
0
        private HandsNorthSouth[] GenerateHandStrings(int batchSize)
        {
            hands = new HandsNorthSouth[batchSize];
            var localshuffleRestrictions = new ShuffleRestrictions();

            for (int i = 0; i < batchSize; ++i)
            {
                int hcp;
                do
                {
                    hands[i] = ShuffleRandomHand();
                    var northHand = hands[i].NorthHand;
                    hcp = northHand.Count(x => x == 'A') * 4 + northHand.Count(x => x == 'K') * 3 + northHand.Count(x => x == 'Q') * 2 + northHand.Count(x => x == 'J');
                }while
                (!localshuffleRestrictions.Match(hands[i].SouthHand) || hcp < 16);
            }

            return(hands);
        }
 public ShuffleRestrictionsForm(ShuffleRestrictions shuffleRestrictions)
 {
     InitializeComponent();
     this.shuffleRestrictions = shuffleRestrictions;
     ObjectToForm(shuffleRestrictions);
 }