Exemplo n.º 1
0
        public DateTime UseItemSucceed(int id)
        {
            var      tpl     = CSTable.ItemUtil.GetItem(id);
            DateTime endTime = DateTime.MinValue;

            if (tpl.ItemType == (int)CSCommon.eItemType.Consumable)
            {
                var   temp  = tpl as CSTable.ItemTplData;
                float delay = temp.CdDelay;
                if (delay <= 0)
                {
                    return(endTime);
                }
                endTime = Time.AddSecondNow(delay);
                var list = GetCdGroup(id);
                if (list != null)
                {
                    foreach (var i in list)
                    {
                        CdManager.Instance.AddItemCd(i, delay, endTime);
                    }
                }
                else
                {
                    CdManager.Instance.AddItemCd(id, delay, endTime);
                }
            }
            return(endTime);
        }