示例#1
0
        internal StatsControl(HandStats handStats, List <Card> lstCrib)
        {
            InitializeComponent();

            this.handStats = handStats;
            this.lstCrib   = lstCrib;
            this.dblMean   = handStats.CalculateMean();
        }
示例#2
0
        /// <summary>
        /// Calculates points for all possible 'cut' cards
        /// </summary>
        private StatsControl RunStats(Hand mainHand, List <Card> lstCrib, Deck deck)
        {
            HandStats handStats;
            Hand      keptHand;

            keptHand = new Hand();

            // put all the cards in the kept hand
            mainHand.Cards.ForEach(p => keptHand.Cards.Add(p));

            // remove the crib cards
            keptHand.Cards.RemoveAll(p => lstCrib.Contains(p));

            handStats = new HandStats(keptHand);

            // calculate points using each possible 'cut' card
            handStats.CalculateAllPoints(deck);

            // return control that will display the stats
            return(new StatsControl(handStats, lstCrib));
        }