示例#1
0
 public GameResult(string name      = null, int?id = null, string description = "", int?metaCritic = null,
                   string released  = null, string background_image = null, string website       = null, dynamic esrb_rating = null,
                   Rating[] ratings = null, dynamic[] developers    = null, dynamic[] publishers = null)
 {
     Name        = name;
     ID          = id;
     Description = RAWGClient.FormatText(description);
     MetaCritic  = metaCritic;
     Released    = DateTime.TryParse(released, out DateTime time) ? time as DateTime? : null;
     ImageURI    = background_image;
     Website     = website;
     UserRating  = ratings is null || ratings.Length == 0 ? null : ratings[0];
     ESRB        = esrb_rating?.name ?? "N/A";
     DeveloperID = developers[0].id;
     PublisherID = publishers[0].id;
 }
示例#2
0
 /// <summary>
 ///     Initializes this class
 /// </summary>
 /// <param name="status">Http response code</param>
 /// <param name="client">The client</param>
 /// <returns>The result of the request</returns>
 internal Result Initialize(HttpStatusCode status, RAWGClient client)
 {
     this.client = client;
     response    = new Response(status);
     return(this);
 }