Exemplo n.º 1
0
 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"]
                ));
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public static Eco FromJson(JsonValue json)
 {
     return(Eco.FromString(json));
 }