public override void CreateReferences()
        {
            base.CreateReferences();

            this.m_enabled                       = this.GetBooleanValue("Disabled", 0) ^ true;
            this.m_existsApple                   = this.GetBooleanValue("ExistsApple", 0);
            this.m_existsAndroid                 = this.GetBooleanValue("ExistsAndroid", 0);
            this.m_existsKunlun                  = this.GetBooleanValue("ExistsKunlun", 0);
            this.m_existsBazaar                  = this.GetBooleanValue("ExistsBazaar", 0);
            this.m_existsTencent                 = this.GetBooleanValue("ExistsTencent", 0);
            this.m_shopItemExportName            = this.GetValue("ShopItemExportName", 0);
            this.m_shopItemInfoExportName        = this.GetValue("ShopItemInfoExportName", 0);
            this.m_shopItemBG                    = this.GetValue("ShopItemBG", 0);
            this.m_redPackage                    = this.GetBooleanValue("RED", 0);
            this.m_offeredByCalendar             = this.GetBooleanValue("OfferedByCalendar", 0);
            this.m_townHallLimitMin              = this.GetIntegerValue("TownhallLimitMin", 0);
            this.m_townHallLimitMax              = this.GetIntegerValue("TownhallLimitMax", 0);
            this.m_resourceAmountFromTownHallCSV = this.GetBooleanValue("ResourceAmountFromThCSV", 0);

            int arraySize = this.GetArraySize("Resources");

            this.m_resourceData  = new LogicArrayList <LogicResourceData>(arraySize);
            this.m_resourceCount = new LogicArrayList <int>(arraySize);

            for (int i = 0; i < arraySize; i++)
            {
                string resourceText = this.GetValue("Resources", i);

                if (resourceText.Length > 0)
                {
                    LogicResourceData data = LogicDataTables.GetResourceByName(resourceText, this);

                    if (data != null)
                    {
                        if (data.GetWarResourceReferenceData() != null)
                        {
                            Debugger.Error("Can't give WarResource as Resource in GemBundleData");
                        }

                        if (data.IsPremiumCurrency())
                        {
                            Debugger.Error("Can't give PremiumCurrency as Resource in GemBundleData");
                        }

                        this.m_resourceCount.Add(this.GetIntegerValue("ResourceAmounts", i));
                    }
                }
            }

            arraySize = this.GetArraySize("Buildings");

            this.m_buildingData   = new LogicArrayList <LogicData>(arraySize);
            this.m_buildingNumber = new LogicArrayList <int>(arraySize);
            this.m_buildingLevel  = new LogicArrayList <int>(arraySize);
            this.m_gemCost        = new LogicArrayList <int>(arraySize);

            for (int i = 0; i < arraySize; i++)
            {
                this.m_buildingNumber.Add(this.GetIntegerValue("BuildingNumber", i));
                this.m_buildingLevel.Add(this.GetIntegerValue("BuildingLevel", i));
                this.m_gemCost.Add(this.GetIntegerValue("GemCost", i));

                string buildingName = this.GetValue("Buildings", i);

                if (buildingName.Length > 0)
                {
                    LogicData data = null;

                    switch (this.GetValue("BuildingType", i))
                    {
                    case "building":
                        data = LogicDataTables.GetBuildingByName(buildingName, this);
                        break;

                    case "deco":
                        data = LogicDataTables.GetDecoByName(buildingName, this);
                        break;
                    }

                    if (data != null)
                    {
                        this.m_buildingData.Add(data);
                    }
                }
            }

            arraySize = this.GetArraySize("UnlocksTroop");

            this.m_unlockTroopData = new LogicArrayList <LogicCombatItemData>(arraySize);

            for (int i = 0; i < arraySize; i++)
            {
                string unlockTroopName = this.GetValue("UnlocksTroop", i);

                if (unlockTroopName.Length > 0)
                {
                    LogicCombatItemData data = null;

                    switch (this.GetValue("TroopType", i))
                    {
                    case "troop":
                        data = LogicDataTables.GetCharacterByName(unlockTroopName, this);
                        break;

                    case "spell":
                        data = LogicDataTables.GetSpellByName(unlockTroopName, this);
                        break;
                    }

                    if (data != null)
                    {
                        this.m_unlockTroopData.Add(data);
                    }
                }
            }

            this.m_billingPackageData = LogicDataTables.GetBillingPackageByName(this.GetValue("BillingPackage", 0), this);

            if (this.m_billingPackageData == null)
            {
                Debugger.Error("No billing package set!");
            }

            this.m_priority                              = this.GetIntegerValue("Priority", 0);
            this.m_frontPageItem                         = this.GetBooleanValue("FrontPageItem", 0);
            this.m_treasureItem                          = this.GetBooleanValue("TreasureItem", 0);
            this.m_valueForUI                            = this.GetIntegerValue("ValueForUI", 0);
            this.m_valueTID                              = this.GetValue("ValueTID", 0);
            this.m_timesCanBePurchased                   = this.GetIntegerValue("TimesCanBePurchased", 0);
            this.m_availableTimeMinutes                  = this.GetIntegerValue("AvailableTimeMinutes", 0);
            this.m_cooldownAfterPurchaseMinutes          = this.GetIntegerValue("CooldownAfterPurchaseMinutes", 0);
            this.m_shopFrontPageCooldownAfterPurchaseMin = this.GetIntegerValue("ShopFrontPageCooldownAfterPurchaseMin", 0);
            this.m_hideTimer                             = this.GetBooleanValue("HideTimer", 0);
            this.m_linkedPackageId                       = this.GetIntegerValue("LinkedPackageID", 0);
            this.m_alternativePackage                    = this.GetName().EndsWith("_ALT");
            this.m_giftGems                              = this.GetIntegerValue("GiftGems", 0);
            this.m_giftUsers                             = this.GetIntegerValue("GiftUsers", 0);

            string replacesBillingPackageName = this.GetValue("ReplacesBillingPackage", 0);

            if (replacesBillingPackageName.Length > 0)
            {
                this.m_replaceBillingPackageData = LogicDataTables.GetBillingPackageByName(replacesBillingPackageName, this);
            }

            if (this.m_giftGems > 0 != this.m_giftUsers > 0)
            {
                Debugger.Error("Gift values should both be ZERO or both be NON-ZERO");
            }

            if (!this.m_frontPageItem && this.m_shopFrontPageCooldownAfterPurchaseMin > 0)
            {
                Debugger.Error("FrontPageItem = FALSE => ShopFrontPageCooldownAfterPurchaseMin must be set 0");
            }

            this.m_villageType = this.GetIntegerValue("VillageType", 0);

            if (this.m_villageType != -1)
            {
                if ((uint)this.m_villageType > 1)
                {
                    Debugger.Error("invalid VillageType");
                }
            }

            if (this.m_enabled && this.m_availableTimeMinutes > 0)
            {
                Debugger.Warning("We should no longer use timed offers. Use chronos instead.");
            }

            if (this.m_offeredByCalendar)
            {
                Debugger.Warning("We no longer support enabling/disabling gem bundles thru chronos. Use chronos offers instead.");
                this.m_offeredByCalendar = false;
            }

            this.m_townHallResourceMultiplier = this.GetIntegerValue("THResourceMultiplier", 0);

            if (this.m_townHallResourceMultiplier <= 0)
            {
                this.m_townHallResourceMultiplier = 100;
            }

            this.m_deliverableBundle = this.CreateBundle();
        }