public PoeItemParser(IItemLexicon itemLexicon, IModParserCollection modParserCollection, string gameItemText) { _itemLexicon = itemLexicon; _modParserCollection = modParserCollection; _gameText = new GameText(gameItemText); }
public void Parse(GameText gameText) { _gameText = gameText; IsWeapon = DetectWeapon(); if (IsWeapon) { ParseWeaponStats(); } }
public BaseItemType Parse(GameText gameText) { var baseItemTypeText = gameText.BaseItemText().Replace(" ", string.Empty); // Simple parse will find "Ruby Ring", complex parse for things like "Thirsty Ruby Ring of Success" BaseItemType baseItemType; if (Enum.TryParse(baseItemTypeText, true, out baseItemType)) { return(baseItemType); } if (TryComplexParse(baseItemTypeText, out baseItemType)) { return(baseItemType); } Log.Error("Couldn't parse base item type of " + baseItemTypeText + " defaulting to CrudeBow"); return(BaseItemType.CrudeBow); }