コード例 #1
0
        public static Item ParseItem(string itemText) {
            var item = new Item();

            // items are split by a series of dashes (--------)
            var itemParts = itemText.Split(SplitString, StringSplitOptions.RemoveEmptyEntries);

            // some preliminary scans to try to detect the item type
            item.Type = ItemTypeHelper.GetType(itemParts[0]);

            item.Identified = !itemText.Contains("Unidentified");

            item.ParseMainProperties(itemParts[0]); // every item has these
            item.ParseSecondaryProperties(itemParts[1]);

            return item;
        }