public BundleLink(Uri address) { if (address is null) { throw new ArgumentNullException(nameof(address)); } Address = address; BundleId = SteamLinkHelper.ExtractBundleId(address); }
// TODO: Implement other stuff (which apps it contains, etc.) public BundlePage(Uri address, HtmlDocument pageHtml) : base(address, pageHtml, HtmlElements.Link, HtmlElements.Div, HtmlElements.HeaderLevel2) { if (!(address.AbsoluteUri ?? string.Empty).StartsWith(PageUrlPrefixes.Bundle, StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException( $"The provided address is invalid. Valid addresses must start with '{PageUrlPrefixes.Bundle}'.", nameof(address)); } BundleId = SteamLinkHelper.ExtractBundleId(address); IncludedAppIds = ExtractIncludedAppIds(); BannerUrl = ExtractBannerUrl(); // Currently, we assume it's always € Price = ExtractPriceInEuros(); }