예제 #1
0
        private void UpdateEmbeddedAnalysisData(DataTable newAnalysisData, Dictionary <string, UciInfoResponse> responseByMove)
        {
            // update only one info per move
            foreach ((string lan, UciInfoResponse info) in responseByMove)
            {
                var move                = Lan.LanToMoveWithSan(info.Fen, lan);
                var multipv             = info.MultiPV.Or(0);
                System.Data.DataRow row = FindOrCreateRowByMoveOrMultiPV(newAnalysisData, move, multipv);

                FillEmbeddedRowFromInfo(row, info);
            }
        }
예제 #2
0
        private void FillEmbeddedRowFromInfo(DataRow row, UciInfoResponse info)
        {
            row["Move"] = Lan.LanToMoveWithSan(info.Fen, info.PV.Or(new List <string>()).FirstOrDefault());
            row["D/SD"] = new KeyValuePair <int, int>(info.Depth.Or(0), info.SelDepth.Or(0));
            var score = info.Score.Or(new UciScore(0, UciScoreType.Cp, UciScoreBoundType.Exact));

            row["Score"]    = score;
            row["ScoreInt"] = score.ToInteger() * GetSideToMoveScoreMultiplier();
            row["Time"]     = TimeSpan.FromSeconds(info.Time.Or(0) / 1000);
            row["Nodes"]    = info.Nodes.Or(0);
            row["NPS"]      = info.Nps.Or(0);
            row["MultiPV"]  = info.MultiPV.Or(0);
            row["TBHits"]   = info.TBHits.Or(0);
        }