コード例 #1
0
 private void ObjectToForm(ShuffleRestrictions shuffleRestrictions)
 {
     checkBoxControls.Checked    = shuffleRestrictions.restrictControls;
     checkBoxShape.Checked       = shuffleRestrictions.restrictShape;
     numericUpDownControls.Value = shuffleRestrictions.controls;
     textBoxShape.Text           = shuffleRestrictions.shape;
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: eddovandenboom/TOSR
        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);
        }
コード例 #3
0
 public ShuffleRestrictionsForm(ShuffleRestrictions shuffleRestrictions)
 {
     InitializeComponent();
     this.shuffleRestrictions = shuffleRestrictions;
     ObjectToForm(shuffleRestrictions);
 }