Example #1
0
 public static Entry FromJson(JsonValue json)
 {
     return(new Entry(
                json["count"],
                json.ContainsKey("first_game") ? Optional <GameHeader> .Create(GameHeader.FromJson(json["first_game"])) : Optional <GameHeader> .CreateEmpty(),
                json.ContainsKey("last_game") ? Optional <GameHeader> .Create(GameHeader.FromJson(json["last_game"])) : Optional <GameHeader> .CreateEmpty(),
                json.ContainsKey("elo_diff") ? Optional <long> .Create(json["elo_diff"]) : 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(GameId < gameHeader.GameId);
        }