示例#1
0
 public int GetStoreItemCostRight(int id)
 {
     StoreProto.Store store = storeProtosData.Find(p => p.ID == id);
     if (store.CurrencyType2 == 0)
     {
         return(store.CurrencyValue1);
     }
     return(store.CurrencyValue2);
 }
示例#2
0
        public int GetDiamondCost(int id)
        {
            StoreProto.Store storeData = storeProtosData.Find(p => p.ID == id);

            if (storeData.CurrencyType1 == (int)CurrencyType.DIAMOND)
            {
                return(storeData.CurrencyValue1);
            }
            if (storeData.CurrencyType2 == (int)CurrencyType.DIAMOND)
            {
                return(storeData.CurrencyValue2);
            }
            DebugUtils.Log(DebugUtils.Type.UI, "The Currency of gift is't Diamond , Please Check ... ");
            return(0);
        }
示例#3
0
        //Get item Cost
        public List <KeyValuePair <RuneCostType, int> > GetItemCost(int itemId)
        {
            List <KeyValuePair <RuneCostType, int> > itemCostKeyValuePair = new List <KeyValuePair <RuneCostType, int> >();

            StoreProto.Store store = DataManager.GetInstance().storeProtoData.Find(p => p.ItemId == itemId);
            if (store.CurrencyValue1 > 0)
            {
                itemCostKeyValuePair.Add(new KeyValuePair <RuneCostType, int>((RuneCostType)store.CurrencyType1, store.CurrencyValue1));
            }

            if (store.CurrencyValue2 > 0)
            {
                itemCostKeyValuePair.Add(new KeyValuePair <RuneCostType, int>((RuneCostType)store.CurrencyType2, store.CurrencyValue2));
            }

            return(itemCostKeyValuePair);
        }
示例#4
0
        //index 0: diaMond	1: gold 2:ember
        public int[] GetUnitCost(int unitId)
        {
            int[] prices = new int[2];

            int goodId = GetStoreItemId(unitId);

            StoreProto.Store store = DataManager.GetInstance().storeProtoData.Find(p => p.ID == goodId);

            int types = store.CurrencyType1;
            int Cost  = store.CurrencyValue1;

            if (types == 1)
            {
                prices[0] = Cost;
            }
            else if (types == 2)
            {
                int types2 = store.CurrencyType2;
                int Cost2  = store.CurrencyValue2;

                prices[1] = Cost;

                if (types2 == 1)
                {
                    prices[0] = Cost2;
                }
                else
                {
                    DebugUtils.LogError(DebugUtils.Type.UI, string.Format("Cost type {0} can't be here.", (Data.CurrencyType)types));
                }
                //TODO:If need ember add logic check in there.
            }
            else
            {
                //TODO:If need ember add logic check in there.
                DebugUtils.LogError(DebugUtils.Type.UI, string.Format("Can't know this cost type {0}", (Data.CurrencyType)types));
            }

            return(prices);
        }