예제 #1
0
        public ShopTemplate GetShop(int id)
        {
            ShopTemplate result = null;

            if (!mShopTbl.TryGetValue(id, out result))
            {
                EB.Debug.LogWarning("GetShop: shop not found, id = {0}", id);
            }
            return(result);
        }
예제 #2
0
        public ShopTemplate GetShopByShopType(string shopType)
        {
            ShopTemplate result = null;

            var enumerator = mShopTbl.Values.GetEnumerator();

            while (enumerator.MoveNext())
            {
                ShopTemplate item = enumerator.Current;
                if (item.shop_type == shopType)
                {
                    result = item;
                    break;
                }
            }
            return(result);
        }
예제 #3
0
        private ShopTemplate ParseShop(GM.DataCache.ShopInfo obj)
        {
            ShopTemplate tpl = new ShopTemplate();

            tpl.id                = obj.Id;
            tpl.shop_type         = obj.ShopType;
            tpl.shop_balance_type = obj.ShopBalanceType;
            //tpl.cost = string.Empty;
            tpl.name                 = EB.Localizer.GetTableString(string.Format("ID_shops_shop_{0}_name", tpl.id), obj.Name);//obj.Name;
            tpl.level_limit          = obj.LevelLimit;
            tpl.refresh_time_1       = obj.RefreshTime1;
            tpl.refresh_time_2       = obj.RefreshTime2;
            tpl.refresh_time_3       = obj.RefreshTime3;
            tpl.refresh_time_4       = obj.RefreshTime4;
            tpl.refresh_balance_type = obj.RefreshBalanceType;
            return(tpl);
        }