mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Simplify the Tablebase struct to the fields the grader reads (#26)
Drop dtm/dtc from Tablebase and Tablebase.Move; the local Syzygy backend cannot produce them and nothing reads them. The Lichess parser now maps only category, checkmate and moves (with per-move category, dtz, san and uci), and the struct-shape tests follow.
This commit is contained in:
@@ -43,8 +43,6 @@ defmodule Chesstrainer.Endgames.Tablebase.Parser do
|
||||
%Tablebase{
|
||||
category: Tablebase.normalize_category(map["category"]),
|
||||
checkmate: map["checkmate"],
|
||||
dtc: map["dtc"],
|
||||
dtm: map["dtm"],
|
||||
moves: Enum.map(map["moves"], &moves_from_map/1)
|
||||
}}
|
||||
end
|
||||
@@ -52,8 +50,6 @@ defmodule Chesstrainer.Endgames.Tablebase.Parser do
|
||||
defp moves_from_map(map) do
|
||||
%Tablebase.Move{
|
||||
category: Tablebase.normalize_category(map["category"]),
|
||||
dtc: map["dtc"],
|
||||
dtm: map["dtm"],
|
||||
dtz: map["dtz"],
|
||||
san: map["san"],
|
||||
uci: map["uci"]
|
||||
|
||||
Reference in New Issue
Block a user