コード例 #1
0
        public int GetUserInventoryNumber(int assetsCategory, string assetsValue)
        {
            global::Debug.Assert(assetsCategory != 0, "アセットカテゴリーIDが設定されていません");
            int result;

            if (string.IsNullOrEmpty(assetsValue))
            {
                result = UserInventory.GetNumber((MasterDataMng.AssetCategory)assetsCategory);
            }
            else if (this.countProtectedAssets)
            {
                result = UserInventory.GetNumber((MasterDataMng.AssetCategory)assetsCategory, assetsValue);
            }
            else
            {
                result = UserInventory.GetNumberExceptProtectedAssets((MasterDataMng.AssetCategory)assetsCategory, assetsValue);
            }
            return(result);
        }
コード例 #2
0
        public void SetUserInventoryNumber(MasterDataMng.AssetCategory assetsCategory, string assetsValue)
        {
            global::Debug.Assert(assetsCategory != MasterDataMng.AssetCategory.NONE, "アセットカテゴリーIDが設定されていません");
            int num;

            if (string.IsNullOrEmpty(assetsValue))
            {
                num = UserInventory.GetNumber(assetsCategory);
            }
            else if (this.countProtectedAssets)
            {
                num = UserInventory.GetNumber(assetsCategory, assetsValue);
            }
            else
            {
                num = UserInventory.GetNumberExceptProtectedAssets(assetsCategory, assetsValue);
            }
            this.SetNumber(num.ToString());
        }
コード例 #3
0
 private void CheckPayAssetsNumber(int price, int playCount)
 {
     MasterDataMng.AssetCategory prizeAssetsCategory = this.gashaInfo.GetPrizeAssetsCategory();
     if (UserInventory.CheckOverNumber(prizeAssetsCategory, 0))
     {
         FactoryLimitOverNotice.CreateDialog(prizeAssetsCategory, LimitOverNoticeType.GASHA);
     }
     else
     {
         MasterDataMng.AssetCategory costAssetsCategory = this.gashaInfo.priceType.GetCostAssetsCategory();
         string costAssetsValue = this.gashaInfo.priceType.GetCostAssetsValue();
         int    num             = UserInventory.GetNumber(costAssetsCategory, costAssetsValue);
         if (this.isTutorial && num < price)
         {
             num = price;
         }
         if (num < price)
         {
             if (costAssetsCategory == MasterDataMng.AssetCategory.DIGI_STONE)
             {
                 CMD_Confirm cmd_Confirm = GUIMain.ShowCommonDialog(new Action <int>(this.OnClosedShopOpenConfirm), "CMD_Confirm", null) as CMD_Confirm;
                 cmd_Confirm.Title      = this.gashaInfo.gachaName;
                 cmd_Confirm.Info       = StringMaster.GetString("GashaShortage");
                 cmd_Confirm.BtnTextYes = StringMaster.GetString("SystemButtonGoShop");
                 cmd_Confirm.BtnTextNo  = StringMaster.GetString("SystemButtonClose");
             }
         }
         else
         {
             GameWebAPI.GA_Req_ExecGacha useDetail = new GameWebAPI.GA_Req_ExecGacha
             {
                 gachaId   = int.Parse(this.gashaInfo.gachaId),
                 playCount = playCount,
                 itemCount = num
             };
             this.cofirmDialog = FactoryPayConfirmNotice.CreateDialog(costAssetsCategory, costAssetsValue, this.gashaInfo.gachaName, num, price, new Action(this.OnPushedConfirmYesButton), playCount, useDetail);
         }
     }
 }
コード例 #4
0
        public void SetPlayButton()
        {
            MasterDataMng.AssetCategory costAssetsCategory = this.gashaInfo.priceType.GetCostAssetsCategory();
            string costAssetsValue = this.gashaInfo.priceType.GetCostAssetsValue();
            int    number          = UserInventory.GetNumber(costAssetsCategory, costAssetsValue);
            int    playCount       = 0;

            for (int i = 0; i < this.gashaInfo.details.Length; i++)
            {
                if (int.TryParse(this.gashaInfo.details[i].count, out playCount))
                {
                    if (this.CheckLimitPlayCount(playCount))
                    {
                        this.buttonList[i].SetButtonAppearance(costAssetsCategory, costAssetsValue, number, this.gashaInfo.details[i].GetPrice());
                    }
                    else
                    {
                        this.buttonList[i].DisableButton();
                    }
                }
            }
        }