public static GameHeader FromJson(JsonValue json)
 {
     return(new GameHeader(
                json["game_id"],
                GameResultHelper.FromStringPgnFormat(json["result"]).First(),
                Date.FromJson(json["date"]),
                Eco.FromJson(json["eco"]),
                json.ContainsKey("ply_count")
             ? Optional <ushort> .Create(json["ply_count"])
             : Optional <ushort> .CreateEmpty(),
                json["event"],
                json["white"],
                json["black"]
                ));
 }
 public GameHeader(
     uint gameId,
     GameResult result,
     Date date,
     Eco eco,
     Optional <ushort> plyCount,
     string @event,
     string white,
     string black
     )
 {
     GameId   = gameId;
     Result   = result;
     Date     = date;
     Eco      = eco;
     PlyCount = plyCount;
     Event    = @event;
     White    = white;
     Black    = black;
 }
Beispiel #3
0
 public static Eco FromJson(JsonValue json)
 {
     return(Eco.FromString(json));
 }