예제 #1
0
        /// <summary>
        /// 初始化转盘
        /// </summary>
        /// <param name="turntableType"></param>
        public void Initialization(int turntableType)
        {
            var list = CacheFactory.TurntableCache.GetTurntableList(turntableType);

            if (list.Count == 0)
            {
                return;
            }
            TurnTableDic = new TurntableList();
            var turntable = new  List <TurntableItem>();

            foreach (var item in list)
            {
                TurntableItem entity = new TurntableItem();
                entity.Idx         = item.TurntableId;
                entity.IsEffective = true;
                entity.Rate        = item.InitialRate;
                entity.IsTurntable = false;
                if (item.PrizeType == (int)EnumTurntablePrizeType.Turntable)
                {
                    entity.IsTurntable = true;
                }
                else if (item.PrizeType == (int)EnumTurntablePrizeType.Special)
                {
                    entity.SpecialItem = AnalysisSpecial(item);
                }
                turntable.Add(entity);
            }
            TurnTableDic.ItemList = turntable;
            TurnTableDic.IsFirst  = true;
            if (!TurnTableListDic.ContainsKey(turntableType))
            {
                TurnTableListDic.Add(turntableType, new TurntableList());
            }
            TurnTableListDic[turntableType]       = TurnTableDic;
            _turntableManagerEntity.TurntableType = turntableType;
            isUpdate = true;
        }