public static Entry FromJson(JObject json) { return(new Entry( json["count"].Value <ulong>(), json.ContainsKey("first_game") ? Optional <GameHeader> .Create(GameHeader.FromJson(json["first_game"].Value <JObject>())) : Optional <GameHeader> .CreateEmpty(), json.ContainsKey("last_game") ? Optional <GameHeader> .Create(GameHeader.FromJson(json["last_game"].Value <JObject>())) : Optional <GameHeader> .CreateEmpty(), json.ContainsKey("elo_diff") ? Optional <long> .Create(json["elo_diff"].Value <long>()) : Optional <long> .CreateEmpty())); }
public bool IsBefore(GameHeader gameHeader) { if (this.Date.IsBefore(gameHeader.Date)) { return(true); } if (gameHeader.Date.IsBefore(this.Date)) { return(false); } return(this.GameId < gameHeader.GameId); }