public static string GetUrl(WebsiteSection section, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage, bool phpLink, int?id = null, int?category = null, int?icon = null, string extra = null) { if (phpLink) { string v = GetPhpUrlGameVersion(version); string l = GetPhpUrlGameLocale(locale); string w = GetPhpUrlWebsiteLanguage(websiteLanguage); string begin = "?version=" + v + versionPostfix + "&locale=" + l + "&compare=" + w; switch (section) { case WebsiteSection.Arte: return(begin + "§ion=artes" + (id != null ? "&id=" + id : "")); case WebsiteSection.Enemy: return(begin + "§ion=enemies&category=" + category + (id != null ? "&id=" + id : "")); case WebsiteSection.Item: return(begin + "§ion=items&icon=" + icon + (id != null ? "&id=" + id : "")); case WebsiteSection.Recipe: return(begin + "§ion=recipes" + (id != null ? "&id=" + id : "")); case WebsiteSection.Skill: return(begin + "§ion=skills" + (id != null ? "&id=" + id : "")); case WebsiteSection.Location: return(begin + "§ion=locations" + (id != null ? "&id=" + id : "")); case WebsiteSection.Shop: return(begin + "§ion=shops" + (id != null ? "&id=" + id : "")); case WebsiteSection.SearchPoint: return(begin + "§ion=searchpoint" + (id != null ? "#searchpoint" + id : "")); case WebsiteSection.Skit: return(begin + "§ion=skit" + (extra != null ? "&name=" + extra : "")); case WebsiteSection.Scenario: return(begin + "§ion=scenario" + (extra != null ? "&name=" + extra : "")); case WebsiteSection.NecropolisMap: return(begin + "§ion=necropolis" + (extra != null ? "&map=" + extra : "")); default: throw new Exception("Unsupported PHP URL requested."); } } else { StringBuilder sb = new StringBuilder(); sb.Append(version.ToString()); sb.Append("-"); sb.Append(section.ToString()); if (category != null) { sb.Append("-c"); sb.Append(category); } if (icon != null) { sb.Append("-i"); sb.Append(icon); } if (extra != null) { sb.Append("-"); sb.Append(extra); } sb.Append(".html"); if (id != null) { sb.Append("#"); sb.Append(section.ToString().ToLowerInvariant()); sb.Append(id); } return(sb.ToString()); } }
public static string GetUrl( WebsiteSection section, GameVersion version, bool phpLink, int? id = null, int? category = null, int? icon = null, string extra = null ) { if ( phpLink ) { string v = GetPhpUrlGameVersion( version ); switch ( section ) { case WebsiteSection.Enemy: return "?version=" + v + "§ion=enemies&category=" + category + ( id != null ? "#enemy" + id : "" ); case WebsiteSection.Item: return "?version=" + v + "§ion=items&icon=" + icon + ( id != null ? "#item" + id : "" ); case WebsiteSection.Recipe: return "?version=" + v + "§ion=recipes" + ( id != null ? "#recipe" + id : "" ); case WebsiteSection.Skill: return "?version=" + v + "§ion=skills" + ( id != null ? "#skill" + id : "" ); case WebsiteSection.Location: return "?version=" + v + "§ion=locations" + ( id != null ? "#location" + id : "" ); case WebsiteSection.Shop: return "?version=" + v + "§ion=shops" + ( id != null ? "#shop" + id : "" ); case WebsiteSection.Skit: return "?version=" + v + "§ion=skit" + ( extra != null ? "&name=" + extra : "" ); case WebsiteSection.Scenario: return "?version=" + v + "§ion=scenario" + ( extra != null ? "&name=" + extra : "" ); default: throw new Exception( "Unsupported PHP URL requested." ); } } else { StringBuilder sb = new StringBuilder(); sb.Append( version.ToString() ); sb.Append( "-" ); sb.Append( section.ToString() ); if ( category != null ) { sb.Append( "-c" ); sb.Append( category ); } if ( icon != null ) { sb.Append( "-i" ); sb.Append( icon ); } if ( extra != null ) { sb.Append( "-" ); sb.Append( extra ); } sb.Append( ".html" ); if ( id != null ) { sb.Append( "#" ); sb.Append( section.ToString().ToLowerInvariant() ); sb.Append( id ); } return sb.ToString(); } }