示例#1
0
        /// <summary>
        /// Create a new shoe
        /// </summary>
        /// <param name="deckCount">The amount of decks to use in the shoe</param>
        /// <param name="countMethod">The count method to use for card counting</param>
        public Shoe(int deckCount, CountMethod countMethod)
        {
            m_deckCount = deckCount;
            m_countMethod = countMethod;

            Initialise();
        }
示例#2
0
文件: Function.cs 项目: yutuo/Laxer
 private Function(string name, int minParam, int maxParam, CountMethod count)
 {
     Name = name;
     MinParam = minParam;
     MaxParam = maxParam;
     Count = count;
 }
示例#3
0
文件: Operate.cs 项目: yutuo/Laxer
 private Operate(string name, char operateChar, int priority, CountMethod count)
 {
     Name = name;
     OperateChar = operateChar;
     Priority = priority;
     Count = count;
 }
示例#4
0
        /// <summary>
        /// Creates a new blackjack game
        /// </summary>
        /// <param name="dealerHitSoftSeventeen">Should the dealer hit on soft 17s?</param>
        /// <param name="deckCount">How many decks to use in the shoe</param>
        /// <param name="countMethod">The counting method to use on the shoe</param>
        /// <param name="sleepTimeBetweenHands">The amount of milliseconds to sleep between each hand</param>
        public BlackjackGame(bool dealerHitSoftSeventeen, int deckCount, CountMethod countMethod, int sleepTimeBetweenHands)
        {
            m_dealer = new DealerEntity(dealerHitSoftSeventeen);
            m_deckCount = deckCount;
            m_countMethod = countMethod;

            m_sleepTimeBetweenhands = sleepTimeBetweenHands;
        }
示例#5
0
 public IPagedList <T> Pager(int pageIndex, int pageSize, string where, CountMethod GetCountMethod)
 {
     this.PageIndex = pageIndex;
     this.PageSize  = pageSize;
     if (GetCountMethod != null)
     {
         //调用GetCoutMethod方法计算数据总数
         this.TotalItemCount = GetCountMethod(where);
         //计算共多少页
         this.TotalPageCount = (int)Math.Ceiling(TotalItemCount / (double)PageSize);
     }
     return(this);
 }
        public Player(Point pntlocation, double dblBank, NumericUpDown betControl, playerType type, Strategy strategy, CountMethod method)
        {
            // Since the game is limited to one split (two hands), just set them up now
            hands = new Hand[2];
            hands[0] = new Hand(new Point(0, 0));
            hands[1] = new Hand(new Point(50, 0));

            // Player specific variables
            location = pntlocation;
            bank = dblBank;
            plyrStrategy = strategy;
            plyrMethod = method;
            plyrType = type;
            plyrBet = betControl;

            // Start out with one hand, they may split pairs to get two
            numberOfHands = 1;
        }
示例#7
0
        /// <summary>
        /// 翻页: 返回数据, 内部已经调用了GetCount方法。
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <param name="sortExpression">排序字段</param>
        /// <param name="startRowIndex">起始页</param>
        /// <param name="maximumRows">每页行数
        /// 可以指定MaxRows.ConfigPageSize常量从配置文件中取PageSize。
        /// MaxRows.AllRows表示取所有行startRowIndex将失效。
        /// </param>
        /// <param name="GetCoutMethod">计算数据数量的方法,默认为空。</param>
        public IPagedList <Logs> GetTables(string where, string sortExpression, int startRowIndex, int maximumRows, CountMethod GetCountMethod)
        {
            //读取配置文件PageSize
            if (maximumRows == MaxRows.ConfigPageSize)
            {
                maximumRows = ConfigPageSize;
            }

            //设置缓存参数
            string key = string.Format(cacheKey + "_getall_where{0}_sortExp{1}_startRowIndex{2}_maximumRows{3}", where, sortExpression, startRowIndex, maximumRows);

            IPagedList <Logs> tables = Provider.GetTables(where, sortExpression, startRowIndex, maximumRows);

            return(CacheData <IPagedList <Logs> >(key, tables).Pager(startRowIndex, maximumRows, where, GetCountMethod));
        }
 public Chromosome(CountMethod countMethod, int countScalar, int betSize)
 {
     CountMethod = countMethod;
     CountScalar = countScalar;
     BetSize = betSize;
 }