Skip to content

Commit

Permalink
use local ceval for multiboard eval if missing or worse
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jan 8, 2024
1 parent f159fe9 commit 2c29091
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/analyse/src/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,10 @@ export default class AnalyseCtrl {
if (path === this.path) {
this.setAutoShapes();
if (!isThreat) {
if (this.retro) this.retro.onCeval();
if (this.practice) this.practice.onCeval();
if (this.studyPractice) this.studyPractice.onCeval();
this.retro?.onCeval();
this.practice?.onCeval();
this.studyPractice?.onCeval();
this.study?.multiBoard.onLocalCeval(node, ev);
this.evalCache.onLocalCeval();
}
this.redraw();
Expand Down
6 changes: 6 additions & 0 deletions ui/analyse/src/study/multiBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ export class MultiBoardCtrl {
};

getCloudEval = (preview: ChapterPreview): CloudEval | undefined => this.cloudEvals.get(preview.fen);

onLocalCeval = (node: Tree.Node, ev: Tree.ClientEval) => {
const cur = this.cloudEvals.get(node.fen);
if (!cur || cur.depth < ev.depth)
this.cloudEvals.set(node.fen, { ...ev, chances: povChances('white', ev) });
};
}

export function view(ctrl: MultiBoardCtrl, study: StudyCtrl): VNode | undefined {
Expand Down

0 comments on commit 2c29091

Please sign in to comment.