protected override WebRequest CreateWebRequest() { var req = base.CreateWebRequest(); if (query != null) { req.AddParameter("q", query); } if (General != null && General.Any()) { req.AddParameter("c", string.Join('.', General.Select(e => e.ToString().Underscore()))); } if (ruleset.OnlineID >= 0) { req.AddParameter("m", ruleset.OnlineID.ToString()); } req.AddParameter("s", SearchCategory.ToString().ToLowerInvariant()); if (Genre != SearchGenre.Any) { req.AddParameter("g", ((int)Genre).ToString()); } if (Language != SearchLanguage.Any) { req.AddParameter("l", ((int)Language).ToString()); } req.AddParameter("sort", $"{SortCriteria.ToString().ToLowerInvariant()}_{directionString}"); if (Extra != null && Extra.Any()) { req.AddParameter("e", string.Join('.', Extra.Select(e => e.ToString().ToLowerInvariant()))); } if (Ranks != null && Ranks.Any()) { req.AddParameter("r", string.Join('.', Ranks.Select(r => r.ToString()))); } if (Played != SearchPlayed.Any) { req.AddParameter("played", Played.ToString().ToLowerInvariant()); } req.AddParameter("nsfw", ExplicitContent == SearchExplicit.Show ? "true" : "false"); req.AddCursor(cursor); return(req); }
public override string ToString() { var final = new StringBuilder(); final.Append($"{Name.PadRight(30)} | "); final.Append($"{Played.ToString().PadLeft(2)} | "); final.Append($"{Won.ToString().PadLeft(2)} | "); final.Append($"{Drawn.ToString().PadLeft(2)} | "); final.Append($"{Lost.ToString().PadLeft(2)} | "); final.Append($"{Point.ToString().PadLeft(2)}"); return(final.ToString()); }
protected override WebRequest CreateWebRequest() { var req = base.CreateWebRequest(); req.AddParameter("q", query); if (ruleset.ID.HasValue) { req.AddParameter("m", ruleset.ID.Value.ToString()); } req.AddParameter("s", SearchCategory.ToString().ToLowerInvariant()); if (Genre != SearchGenre.Any) { req.AddParameter("g", ((int)Genre).ToString()); } if (Language != SearchLanguage.Any) { req.AddParameter("l", ((int)Language).ToString()); } req.AddParameter("sort", $"{SortCriteria.ToString().ToLowerInvariant()}_{directionString}"); if (Extra != null && Extra.Any()) { req.AddParameter("e", string.Join('.', Extra.Select(e => e.ToString().ToLowerInvariant()))); } if (Ranks != null && Ranks.Any()) { req.AddParameter("r", string.Join('.', Ranks.Select(r => r.ToString()))); } if (Played != SearchPlayed.Any) { req.AddParameter("played", Played.ToString().ToLowerInvariant()); } req.AddCursor(cursor); return(req); }