/// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="spellItemModel">Spell item model.</param>
        /// <param name="itemCount">Item count.</param>
        public SpellItem(SpellItemModel spellItemModel, int itemCount)
        {
            InitBaseProperties(spellItemModel);

            this.itemType = ItemType.SpellItem;

            this.spellItemType = spellItemModel.spellItemType;

            this.attachInfo_1 = spellItemModel.attachInfo_1;

            this.attachInfo_2 = spellItemModel.attachInfo_2;

            this.spell = spellItemModel.spell;

            this.phoneticSymbol = spellItemModel.phoneticSymbol;

            this.pronounciationURL = spellItemModel.pronounciationURL;

            this.itemCount = itemCount;
        }
Beispiel #2
0
        public void LoadAllItemsWithFullDataString(string fullItemDataString)
        {
            string[] seperateItemDataArray = fullItemDataString.Split(new string[] { "\n" }, StringSplitOptions.None);


            for (int i = 2; i < seperateItemDataArray.Length; i++)
            {
                string spellItemDataString = seperateItemDataArray[i].Replace("\r", "");

                string[] spellItemDataArray = spellItemDataString.Split(new char[] { ',' }, StringSplitOptions.None);

                int dataLength = spellItemDataArray.Length;

                SpellItemModel spellItemModel = new SpellItemModel();

                spellItemModels.Add(spellItemModel);

                spellItemModel.itemId = FromStringToInt16(spellItemDataArray[0]);

                spellItemModel.itemName = spellItemDataArray[1];

                spellItemModel.spriteName = spellItemDataArray[3];

                spellItemModel.spell = spellItemDataArray[4];

                //spellItemModel.itemDescription = spellItemDataArray[4];

                spellItemModel.phoneticSymbol = spellItemDataArray[5];

                spellItemModel.pronounciationURL = spellItemDataArray[6];

                spellItemModel.spellItemType = (SpellItemType)(FromStringToInt16(spellItemDataArray[7]));

                spellItemModel.attachInfo_1 = FromStringToInt16(spellItemDataArray[8]);

                spellItemModel.attachInfo_2 = FromStringToInt16(spellItemDataArray[9]);

                //spellItemModel.price = FromStringToInt32(spellItemDataArray[8]);
            }
        }