/// <summary> /// Tries to parse the InventorySlot from a string. /// </summary> /// <param name="parser">The Parser to use.</param> /// <param name="value">The string to parse.</param> /// <param name="outValue">If this method returns true, contains the parsed InventorySlot.</param> /// <returns>True if the parsing was successfully; otherwise false.</returns> public static bool TryParse(this Parser parser, string value, out InventorySlot outValue) { byte tmp; var ret = parser.TryParse(value, out tmp); outValue = new InventorySlot(tmp); return(ret); }
/// <summary> /// Tries to parse the GrhIndex from a string. /// </summary> /// <param name="parser">The Parser to use.</param> /// <param name="value">The string to parse.</param> /// <param name="outValue">If this method returns true, contains the parsed GrhIndex.</param> /// <returns>True if the parsing was successfully; otherwise false.</returns> public static bool TryParse(this Parser parser, string value, out GrhIndex outValue) { ushort tmp; var ret = parser.TryParse(value, out tmp); outValue = new GrhIndex(tmp); return(ret); }
/// <summary> /// When overridden in the derived class, tries to parse the given value from the string. /// </summary> /// <param name="parser">The <see cref="Parser"/> to use to parse the <paramref name="valueString"/>.</param> /// <param name="valueString">The string to parse.</param> /// <param name="value">The value parsed from the string.</param> /// <returns> /// True if parsed successfully; otherwise false. /// </returns> protected override bool TryParse(Parser parser, string valueString, out int value) { return(parser.TryParse(valueString, out value)); }