Ejemplo n.º 1
0
        public static int GetNumberExceptProtectedAssets(MasterDataMng.AssetCategory category, string assetsValue)
        {
            int num = -1;

            if (category != MasterDataMng.AssetCategory.MONSTER)
            {
                if (category != MasterDataMng.AssetCategory.CHIP)
                {
                    num = UserInventory.GetNumber(category, assetsValue);
                }
                else if (ChipDataMng.userChipData != null && ChipDataMng.userChipData.userChipList != null)
                {
                    if (string.IsNullOrEmpty(assetsValue) || "0" == assetsValue)
                    {
                        num = 0;
                        for (int i = 0; i < ChipDataMng.userChipData.userChipList.Length; i++)
                        {
                            if (ChipDataMng.userChipData.userChipList[i].userMonsterId == 0)
                            {
                                num++;
                            }
                        }
                    }
                    else
                    {
                        int num2 = 0;
                        if (int.TryParse(assetsValue, out num2))
                        {
                            num = 0;
                            for (int j = 0; j < ChipDataMng.userChipData.userChipList.Length; j++)
                            {
                                GameWebAPI.RespDataCS_ChipListLogic.UserChipList userChipList = ChipDataMng.userChipData.userChipList[j];
                                if (userChipList.chipId == num2 && userChipList.userMonsterId == 0)
                                {
                                    num++;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                Debug.LogError("未実装");
            }
            Debug.Assert(-1 != num, "アセット所持数の取得に失敗.");
            return(num);
        }
Ejemplo n.º 2
0
        public static int GetNumber(MasterDataMng.AssetCategory category, string assetsValue)
        {
            int num = -1;

            switch (category)
            {
            case MasterDataMng.AssetCategory.GATHA_TICKET:
                Debug.LogError("未実装");
                break;

            default:
                if (category != MasterDataMng.AssetCategory.CHIP)
                {
                    if (category != MasterDataMng.AssetCategory.DUNGEON_TICKET)
                    {
                        if (category != MasterDataMng.AssetCategory.MONSTER)
                        {
                            if (category != MasterDataMng.AssetCategory.ITEM)
                            {
                                num = UserInventory.GetNumber(category);
                            }
                            else
                            {
                                int itemId = 0;
                                if (int.TryParse(assetsValue, out itemId))
                                {
                                    num = Singleton <UserDataMng> .Instance.GetUserItemNumByItemId(itemId);
                                }
                            }
                        }
                        else
                        {
                            int num2 = 0;
                            if (string.IsNullOrEmpty(assetsValue) || "0" == assetsValue)
                            {
                                num = ClassSingleton <MonsterUserDataMng> .Instance.GetMonsterNum();
                            }
                            else if (int.TryParse(assetsValue, out num2))
                            {
                                Debug.LogError("未実装");
                            }
                        }
                    }
                    else
                    {
                        Debug.LogError("未実装");
                    }
                }
                else if (ChipDataMng.userChipData != null && ChipDataMng.userChipData.userChipList != null)
                {
                    if (string.IsNullOrEmpty(assetsValue) || "0" == assetsValue)
                    {
                        num = ChipDataMng.userChipData.userChipList.Length;
                    }
                    else
                    {
                        int num3 = 0;
                        if (int.TryParse(assetsValue, out num3))
                        {
                            num = 0;
                            for (int i = 0; i < ChipDataMng.userChipData.userChipList.Length; i++)
                            {
                                if (ChipDataMng.userChipData.userChipList[i].chipId == num3)
                                {
                                    num++;
                                }
                            }
                        }
                    }
                }
                break;

            case MasterDataMng.AssetCategory.SOUL:
                num = EvolutionMaterialData.GetUserEvolutionMaterialNum(assetsValue);
                break;
            }
            Debug.Assert(-1 != num, "アセット所持数の取得に失敗.");
            return(num);
        }