/// <inheritdoc /> /// <summary> /// Reads an object's state from a Yaml parser. /// </summary> public object ReadYaml(IParser parser, Type type) { var value = ((Scalar)parser.Current).Value.Trim(); parser.MoveNext(); long id; if (Steam64Regex.IsMatch(value)) { id = long.Parse(value); } else if (Steam2Regex.IsMatch(value)) { id = SteamId.FromSteamId2(value); } else if (Steam32Regex.IsMatch(value)) { id = SteamId.FromSteamId32(value); } else { throw new YamlException("YML input not in valid SteamID 2, 32 or 64 format"); } return(new SteamId(id)); }