Exemplo n.º 1
0
        private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); //

        #endregion

        #region 初始化

        public void InitByBase(GroupShopOne _this, GroupShopRecord tbTable)
        {
            _this.mDbData = new DBGroupShopOne();
            if (_this.mDbData.ItemData == null)
            {
                _this.mDbData.ItemData = new ItemBaseData();
            }
            _this.tbGroupShop         = tbTable;
            _this.mDbData.GroupShopId = tbTable.Id;
            _this.OverTime            = DateTime.Now.AddHours(tbTable.ExistTime);
            var items = new Dictionary <int, int>();

            ShareDrop.DropMother(tbTable.MotherID, items);
            var itemsCount = items.Count;

            if (itemsCount < 1)
            {
                ShareItemFactory.Create(22000, _this.mDbData.ItemData);
            }
            else
            {
                var itemT = items.First();
                var item  = ShareItemFactory.Create(itemT.Key, _this.mDbData.ItemData);
                item.SetCount(itemT.Value);
                if (itemsCount > 1)
                {
                    Logger.Warn("GroupShopOne InitByBase itemsCount ={0} GroupShopRecord={1}", itemsCount, tbTable.Id);
                }
            }
            _this.overTrigger = TeamServerControl.tm.CreateTrigger(_this.OverTime, () => TimeOver(_this));
        }
Exemplo n.º 2
0
        private void AddItem(GroupShopRecord tbGroupShop)
        {
            var nextGuid = GetNextGuid();
            var temp     = new GroupShopOne();

            temp.InitByBase(tbGroupShop);
            temp.Guid = nextGuid;
            GroupShop.DbData.ItemList.Add(temp.mDbData);
            GroupShop.Datas.Add(nextGuid, temp);
            var tempList = GroupShop.StoreList[tbGroupShop.Id];

            tempList.Add(temp);
            GroupShop.Dirty = true;
        }
Exemplo n.º 3
0
 public void InitByBase(GroupShopRecord tbTable)
 {
     mImpl.InitByBase(this, tbTable);
 }