Example #1
0
 private void LackResArr()
 {
     if (_resArr != null)
     {
         _resArr[0] = Model_Helper.GetNeedBuyFoodCount((int)_data_Building.cost.costFood);
         _resArr[1] = Model_Helper.GetNeedBuyOilCount((int)_data_Building.cost.costOil);
         _resArr[2] = Model_Helper.GetNeedBuyMetalCount((int)_data_Building.cost.costMetal);
         _resArr[3] = Model_Helper.GetNeedBuyRareCount((int)_data_Building.cost.costRare);
     }
 }
Example #2
0
    //获取玩家缺少的资源种类及数量
    public static int[] GetPlayerNeedBuyRes(int needFood, int needOil, int needMetal, int needRare)
    {
        int[] resArr = new int[4];
        int   food   = 0;
        int   oil    = 0;
        int   metal  = 0;
        int   rare   = 0;

        food  = Model_Helper.GetNeedBuyFoodCount(needFood);
        oil   = Model_Helper.GetNeedBuyOilCount(needOil);
        metal = Model_Helper.GetNeedBuyMetalCount(needMetal);
        rare  = Model_Helper.GetNeedBuyRareCount(needRare);

        if (resArr != null)
        {
            resArr[0] = food;
            resArr[1] = oil;
            resArr[2] = metal;
            resArr[3] = rare;
        }
        return(resArr);
    }