Skip to content

Commit

Permalink
Add events to tie into when autoscoring begins and ends
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Sep 4, 2024
1 parent caccee1 commit 3dbcedb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Goban/OGSConnectivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,7 @@ export abstract class OGSConnectivity extends GobanInteractive {
this.stone_removal_auto_scoring_done = true;

this.showMessage("processing", undefined, -1);
this.emit("stone-removal.auto-scoring-started");
const do_score_estimation = () => {
const se = new ScoreEstimator(
this.engine,
Expand Down Expand Up @@ -1430,6 +1431,7 @@ export abstract class OGSConnectivity extends GobanInteractive {
});

this.clearMessage();
this.emit("stone-removal.auto-scoring-complete");
})
.catch((err) => {
console.error(`Auto-scoring error: `, err);
Expand Down
2 changes: 2 additions & 0 deletions src/GobanBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ export interface GobanEvents extends StateUpdateEvents {
"stone-removal.accepted": () => void;
"stone-removal.updated": () => void;
"stone-removal.needs-sealing": (positions: undefined | JGOFSealingIntersection[]) => void;
"stone-removal.auto-scoring-started": () => void;
"stone-removal.auto-scoring-complete": () => void;
"conditional-moves.updated": () => void;
"puzzle-place": (obj: {
x: number;
Expand Down

0 comments on commit 3dbcedb

Please sign in to comment.